From bdda11ab4054fb224fc2787d6f97f4bf0ac3a6d1 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 26 Jun 2014 17:52:37 +0200 Subject: [PATCH] [IMP] Update views and production_delay and track_production should go to product_template --- addons/mrp/mrp_view.xml | 6 +++--- addons/mrp/product.py | 16 ++++++++-------- addons/purchase/purchase.py | 4 ---- addons/stock/product_view.xml | 14 +++++++------- addons/stock/stock_view.xml | 27 --------------------------- 5 files changed, 18 insertions(+), 49 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 52e0f539b80..fe20552d0fa 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -561,10 +561,10 @@ - + product.form.mrp.inherited - product.product - + product.template + diff --git a/addons/mrp/product.py b/addons/mrp/product.py index 97ef9cf0494..6d0d93bd5f5 100644 --- a/addons/mrp/product.py +++ b/addons/mrp/product.py @@ -41,10 +41,17 @@ class product_template(osv.osv): return res _columns = { - "bom_ids": fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'), + 'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."), + 'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"), + 'bom_ids': fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'), 'bom_count': fields.function(_bom_orders_count, string='# Bill of Material', type='integer', multi="_bom_order_count"), 'mo_count': fields.function(_bom_orders_count_mo, string='# Manufacturing Orders', type='integer'), } + + _defaults = { + "produce_delay": 1, + } + def copy(self, cr, uid, id, default=None, context=None): if not default: default = {} @@ -63,15 +70,8 @@ class product_product(osv.osv): return res _columns = { - "produce_delay": fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."), - 'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"), 'mo_count': fields.function(_bom_orders_count, string='# Manufacturing Orders', type='integer'), } - - _defaults = { - "produce_delay": 1, - } - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index ca618f76948..db1bce052d3 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1465,9 +1465,5 @@ class account_invoice_line(osv.Model): readonly=True), } -class product_template(osv.osv): - _inherit = "product.template" - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index c3941eb1887..3b9ac4053fa 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -111,6 +111,13 @@ + + + + + + + @@ -192,13 +199,6 @@ product.product - - - - - - -