Browse Source

Añade historial de compras en la variante de produtos

sebastian 5 years ago
commit
895b5df36d
9 changed files with 65 additions and 0 deletions
  1. 5 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 25 0
      __openerp__.py
  4. 5 0
      models/__init__.py
  5. BIN
      models/__init__.pyc
  6. 11 0
      models/product.py
  7. BIN
      models/product.pyc
  8. BIN
      static/description/icon.png
  9. 19 0
      views/product_view.xml

+ 5 - 0
__init__.py

@@ -0,0 +1,5 @@
+# -*- encoding: utf-8 -*-
+
+import models
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
__init__.pyc


+ 25 - 0
__openerp__.py

@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+###########################################################################
+
+###########################################################################
+
+{
+    "name": "Product Purchase Details",
+    "category": "Purchase",
+    "version": "1.0.0",
+    "summary": """Purchase Details or Purchase History on product from view.""",
+    "description": """Purchase details on product from view.""",
+    "author": "Eiru Software",
+    "website": "http://www.eiru.com.py",
+    "depends": ["purchase"],
+    "data": [
+        'views/product_view.xml',
+    ],
+    "images": [
+    ],
+    "installable": True,
+    "application": False,
+    "sequence": 1,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 5 - 0
models/__init__.py

@@ -0,0 +1,5 @@
+#- * -coding: utf - 8 - * -
+
+import product
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
models/__init__.pyc


+ 11 - 0
models/product.py

@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+
+from openerp import api, fields, models ,_
+
+class ProductProduct(models.Model):
+    _inherit = 'product.product'
+
+    purchase_line_ids = fields.One2many('purchase.order.line', 'product_id', 'Purchase Lines') 
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
models/product.pyc


BIN
static/description/icon.png


+ 19 - 0
views/product_view.xml

@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- Product View -->
+        <record id="product_normal_form_view_purchase_history" model="ir.ui.view">
+            <field name="name">product.product.form</field>
+            <field name="model">product.product</field>
+            <field name="inherit_id" ref="product.product_normal_form_view"/>
+            <field name="arch" type="xml">
+                <xpath expr="//notebook/page[@string='Sales']" position="after">
+                    <page name="cost" string="Historial de Compras">
+                        <field name="purchase_line_ids"/>
+                    </page>
+                </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>