From 0af018bb5451d4da79cab784195e21a41ddbbe30 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 7 Jan 2014 12:07:19 +0100 Subject: [PATCH] [FIX] stock: adapted the change qty wizard to the move of track_production in MRP module (fields_view_get overridding removed, the field may not be required as it will raise an error if needed) bzr revid: qdp-launchpad@openerp.com-20140107110719-snz3nw8fpn8e7m0f --- addons/stock/wizard/stock_change_product_qty.py | 11 ----------- addons/stock/wizard/stock_change_product_qty_view.xml | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py index 3b40557884a..7e86c07b28f 100644 --- a/addons/stock/wizard/stock_change_product_qty.py +++ b/addons/stock/wizard/stock_change_product_qty.py @@ -33,17 +33,6 @@ class stock_change_product_qty(osv.osv_memory): 'lot_id': fields.many2one('stock.production.lot', 'Serial Number', domain="[('product_id','=',product_id)]"), 'location_id': fields.many2one('stock.location', 'Location', required=True, domain="[('usage', '=', 'internal')]"), } - - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - if context is None: context = {} - fvg = super(stock_change_product_qty, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) - product_id = context and context.get('active_id', False) or False - - if view_type == 'form' and (context.get('active_model') == 'product.product') and product_id: - prod_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - fvg['fields']['lot_id']['required'] = prod_obj.track_production - - return fvg def default_get(self, cr, uid, fields, context): """ To get default values for the object. diff --git a/addons/stock/wizard/stock_change_product_qty_view.xml b/addons/stock/wizard/stock_change_product_qty_view.xml index 18c548b2c65..81016e467e9 100644 --- a/addons/stock/wizard/stock_change_product_qty_view.xml +++ b/addons/stock/wizard/stock_change_product_qty_view.xml @@ -15,7 +15,7 @@