[FIX] module:mrp added on_change on bom_id for selecting routing

lp bug: https://launchpad.net/bugs/411329 fixed

bzr revid: hda@hda-20090811133217-ml1ac1001u6r6oso
This commit is contained in:
husen daudi 2009-08-11 19:02:17 +05:30
parent 587b335718
commit c4dc4b4cb6
2 changed files with 9 additions and 1 deletions

View File

@ -483,6 +483,14 @@ class mrp_production(osv.osv):
result = {'product_uom':uom}
return {'value':result}
def bom_id_change(self, cr, uid, ids, product):
if not product:
return {}
res = self.pool.get('mrp.bom').read(cr, uid, [product], ['routing_id'])[0]
routing_id = res['routing_id'] and res['routing_id'][0]
result = {'routing_id':routing_id}
return {'value':result}
def action_picking_except(self, cr, uid, ids):
self.write(cr, uid, ids, {'state':'picking_except'})
return True

View File

@ -464,7 +464,7 @@
<page string="Consumed Products">
<field name="location_src_id" select="2" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
<field name="bom_id" select="2" domain="[('product_id','=',product_id),('bom_id','=',False)]"/>
<field name="bom_id" select="2" domain="[('product_id','=',product_id),('bom_id','=',False)]" on_change="bom_id_change(bom_id)"/>
<field name="routing_id" groups="base.group_extended" select="1"/>
<newline/>
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list"/>