[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
This commit is contained in:
Quentin (OpenERP) 2014-01-07 12:07:19 +01:00
parent e3d7ff9c69
commit 0af018bb54
2 changed files with 1 additions and 12 deletions

View File

@ -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.

View File

@ -15,7 +15,7 @@
<footer>
<button name="change_product_qty" string="_Apply" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
<button string="_Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>