Browse Source

commit inicial

Rodney Enciso Arias 7 years ago
commit
96891aada3
8 changed files with 81 additions and 0 deletions
  1. 6 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 22 0
      __openerp__.py
  4. 12 0
      account_invoice.py
  5. BIN
      account_invoice.pyc
  6. 3 0
      static/src/css/custom.css
  7. 28 0
      views/account_invoice.xml
  8. 10 0
      views/templates.xml

+ 6 - 0
__init__.py

@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+from . import account_invoice

BIN
__init__.pyc


+ 22 - 0
__openerp__.py

@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+{
+    'name': 'Factory Reference in Invoice',
+    'version': '1.0',
+    'description': """
+""",
+    'category': 'extra tool',
+    'author': 'Eiru Software',
+    'website': 'http://www.eiru.com.py/',
+    'license': 'AGPL-3',
+    'depends': [
+        'account'
+    ],
+    'data': [
+        'views/templates.xml',
+        'views/account_invoice.xml',
+    ],
+    'demo_xml': [],
+    'test': [],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 12 - 0
account_invoice.py

@@ -0,0 +1,12 @@
+from openerp import models,api,fields
+
+class AccountInvoiceLine(models.Model):
+    _inherit = 'account.invoice.line'
+    _name = 'account.invoice.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
account_invoice.pyc


+ 3 - 0
static/src/css/custom.css

@@ -0,0 +1,3 @@
+.oe_chatter{
+    display: none !important;
+}

+ 28 - 0
views/account_invoice.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record id="account_invoice_form_view" model="ir.ui.view">
+            <field name="name">account.invoice.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//tree/field[@name='product_id']" position="after">
+                    <field name="product_factory_ref"/>
+                </xpath>
+                <xpath expr="//field[@name='invoice_line']/tree//field[@name='account_id']" position="attributes">
+                    <attribute name="invisible">0</attribute>
+                </xpath>   
+            </field>
+        </record>
+        <record id="account_invoice_supplier_form_view" model="ir.ui.view">
+            <field name="name">account.invoice.supplier.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_supplier_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//tree/field[@name='product_id']" position="after">
+                    <field name="product_factory_ref"/>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 10 - 0
views/templates.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <template id="factory_reference_invoice_assets" inherit_id="eiru_assets.assets">
+            <xpath expr="." position="inside">
+                <link rel="stylesheet" href="/factory_reference_invoice/static/src/css/custom.css" />
+            </xpath>
+        </template>
+    </data>
+</openerp>