Rodney Enciso Arias 8 anni fa
commit
2cadc8b3c7
6 ha cambiato i file con 61 aggiunte e 0 eliminazioni
  1. 1 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 15 0
      __openerp__.py
  4. 12 0
      factory_ref.py
  5. BIN
      factory_ref.pyc
  6. 33 0
      factory_ref_view.xml

+ 1 - 0
__init__.py

@@ -0,0 +1 @@
+from . import factory_ref

BIN
__init__.pyc


+ 15 - 0
__openerp__.py

@@ -0,0 +1,15 @@
+{
+    'name':'Sale Order Product Factory Ref.',
+    'description':"""
+Sale Order Product Factory Ref.
+===============================
+Show the factory reference field into sale order line, show field create_id and clean the view
+""",
+    'author': 'Eiru Software/Rodney Enciso Arias',
+    'website':'www.paraguayenlaweb.com',
+    'depends':['base','sale','product_barcode_athletic'],
+    'data':[
+        'factory_ref_view.xml',
+    ],
+    'installable':True,
+}

+ 12 - 0
factory_ref.py

@@ -0,0 +1,12 @@
+from openerp import models,api,fields
+
+class sale_order_line(models.Model):
+    _inherit = 'sale.order.line'
+    _name = 'sale.order.line'
+
+    @api.one
+    @api.depends('product_id')
+    def _get_factory_ref(self):
+        self.product_factory_ref = self.product_id.factory_reference
+
+    product_factory_ref = fields.Char(string="Referencia de Fabrica", compute="_get_factory_ref")

BIN
factory_ref.pyc


+ 33 - 0
factory_ref_view.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+       <record model="ir.ui.view" id="sale_order_factory_ref_view">
+           <field name="name">sale.order.factory.ref.view</field>
+           <field name="model">sale.order</field>
+           <field name="inherit_id" ref="sale.view_order_form"/>
+           <field name="arch" type="xml">
+               <xpath expr="//tree/field[@name='product_id']" position="after">
+                    <field name="product_factory_ref"/>
+               </xpath>
+               <xpath expr="//tree/field[@name='name']" position="replace">
+                    <field name="name" invisible="1"/>
+               </xpath>
+               <field name="date_order" position="after">
+                    <field name="create_uid" readonly="1"/>
+               </field>
+               <field name="client_order_ref" position="replace">
+                    <field name="client_order_ref" invisible="1"/>
+               </field>
+               <field name="note" position="replace">
+                    <field name="note" invisible="1"/>
+               </field>
+               <field name="message_ids" position="replace">
+                    <field name="message_ids" invisible="1"/>
+               </field>
+               <field name="message_follower_ids" position="replace">
+                    <field name="message_follower_ids" invisible="1"/>
+               </field>
+           </field>
+       </record>
+   </data>
+</openerp>