From d7496a8ea44df329960c6572b94ef3ec72902b69 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 15 Dec 2010 11:56:29 +0530 Subject: [PATCH] [FIX]Warehouse:-shouldnt be able to change the company after have validated an inventory lp bug: https://launchpad.net/bugs/690228 fixed bzr revid: ron@tinyerp.com-20101215062629-dl40cw2g1kyacgpw --- addons/stock/stock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4d6b2643743..5b4c87c26ef 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1671,7 +1671,7 @@ class stock_move(osv.osv): result['product_qty'] = product_uos_qty return {'value': result} - + def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, address_id=False): """ On change of product id, if finds UoM, UoS, quantity and UoS quantity. @@ -2440,7 +2440,8 @@ class stock_inventory(osv.osv): 'inventory_line_id': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', states={'done': [('readonly', True)]}), 'move_ids': fields.many2many('stock.move', 'stock_inventory_move_rel', 'inventory_id', 'move_id', 'Created Moves'), 'state': fields.selection( (('draft', 'Draft'), ('done', 'Done'), ('confirm','Confirmed'),('cancel','Cancelled')), 'State', readonly=True, select=True), - 'company_id': fields.many2one('res.company','Company',required=True,select=True), + 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, readonly=True, states={'draft':[('readonly',False)]}), + } _defaults = { 'date': time.strftime('%Y-%m-%d %H:%M:%S'),