Explorar el Código

commit inicial

Adrielso hace 8 años
commit
e0184741ac

+ 2 - 0
__init__.py

@@ -0,0 +1,2 @@
+# -*- encoding: utf-8 -*-
+from . import models

BIN
__init__.pyc


+ 10 - 0
__openerp__.py

@@ -0,0 +1,10 @@
+# -*- encoding: utf-8 -*-
+{
+    'name': 'inventory Order Line Seperate Product Code',
+    'version': '8.0.0.0.1',
+    'author': 'Adrielso',
+    'category':	'stock',
+    'complexity': 'normal',
+    'depends':	[ 'stock', ],
+    'data': ['views/stock_inventory_line.xml',],
+}

+ 2 - 0
models/__init__.py

@@ -0,0 +1,2 @@
+# -*- encoding: utf-8 -*-
+from . import stock_inventory_line

BIN
models/__init__.pyc


+ 40 - 0
models/stock_inventory_line.py

@@ -0,0 +1,40 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2015 ICTSTUDIO (<http://www.ictstudio.eu>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import logging
+from openerp import models, fields, api, _
+
+_logger = logging.getLogger(__name__)
+
+
+class StockInventoryLine(models.Model):
+    _inherit = 'stock.inventory.line'
+
+    product_code = fields.Char(
+            compute="_get_product_info",
+            string="Code",
+            store=True
+    )
+
+    @api.one
+    @api.depends('product_id','product_id.default_code')
+    def _get_product_info(self):
+        if self.product_id:
+            self.product_code = self.product_id.default_code

BIN
models/stock_inventory_line.pyc


BIN
static/description/icon.png


+ 17 - 0
views/stock_inventory_line.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+	<data>
+
+        <record id="view_order_add_code_form" model="ir.ui.view">
+            <field name="name">view.order.add.code.form</field>
+            <field name="model">stock.inventory</field>
+            <field name="inherit_id" ref="stock.view_inventory_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='line_ids']/tree//field[@name='product_id']" position="after">
+                    <field name="product_code" read_only="1"/>
+                </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>