[IMP] Added context whereever necessary, improved code of action_done and removed unwanted spaces.
bzr revid: psa@tinyerp.com-20130527110901-q6717focg99qq46a
This commit is contained in:
parent
27216b2702
commit
f630a3a64a
|
@ -776,7 +776,7 @@ class mrp_production(osv.osv):
|
|||
new_parent_ids.append(final_product.id)
|
||||
for new_parent_id in new_parent_ids:
|
||||
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
|
||||
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
|
||||
return True
|
||||
|
@ -985,7 +985,7 @@ class mrp_production(osv.osv):
|
|||
for production in self.browse(cr, uid, ids, context=context):
|
||||
shipment_id = self._make_production_internal_shipment(cr, uid, production, context=context)
|
||||
produce_move_id = self._make_production_produce_line(cr, uid, production, context=context)
|
||||
|
||||
|
||||
# Take routing location as a Source Location.
|
||||
source_location_id = production.location_src_id.id
|
||||
if production.bom_id.routing_id and production.bom_id.routing_id.location_id:
|
||||
|
@ -996,7 +996,7 @@ class mrp_production(osv.osv):
|
|||
shipment_move_id = self._make_production_internal_shipment_line(cr, uid, line, shipment_id, consume_move_id,\
|
||||
destination_location_id=source_location_id, context=context)
|
||||
self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)
|
||||
|
||||
|
||||
wf_service.trg_validate(uid, 'stock.picking', shipment_id, 'button_confirm', cr)
|
||||
production.write({'state':'confirmed'}, context=context)
|
||||
return shipment_id
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<field name="condition">picking_id and picking_id.state=='done'</field>
|
||||
</record>
|
||||
|
||||
<record id="prod_trans_in_production_done_jap_final" model="workflow.transition">
|
||||
<record id="prod_trans_in_production_done_final" model="workflow.transition">
|
||||
<field name="act_from" ref="prod_act_ready"/>
|
||||
<field name="act_to" ref="prod_act_done"/>
|
||||
<field name="signal">button_produce_done</field>
|
||||
|
@ -85,7 +85,6 @@
|
|||
<field name="act_to" ref="prod_act_in_production"/>
|
||||
<field name="signal">button_produce</field>
|
||||
</record>
|
||||
|
||||
<record id="prod_trans_in_production_done" model="workflow.transition">
|
||||
<field name="act_from" ref="prod_act_in_production"/>
|
||||
<field name="act_to" ref="prod_act_done"/>
|
||||
|
|
|
@ -153,14 +153,12 @@ class StockMove(osv.osv):
|
|||
production_obj = self.pool.get('mrp.production')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for move in self.browse(cr, uid, ids, context=context):
|
||||
production_ids = production_obj.search(cr, uid, [('move_created_ids', 'in', [move.id])])
|
||||
production_ids = production_obj.search(cr, uid, [('move_created_ids', 'in', [move.id])], context=context)
|
||||
if production_ids:
|
||||
product_data = production_obj.browse(cr, uid, production_ids[0])
|
||||
if product_data.move_created_ids2 and product_data.move_lines2 and move.state=='done':
|
||||
product_data = production_obj.browse(cr, uid, production_ids[0], context=context)
|
||||
if product_data.move_created_ids2 and move.state=='done':
|
||||
wf_service.trg_validate(uid, 'mrp.production', product_data.id, 'button_produce_done', cr)
|
||||
elif not product_data.move_lines2 and move.state=='done':
|
||||
wf_service.trg_validate(uid, 'mrp.production', product_data.id, 'button_produce_done', cr)
|
||||
return res
|
||||
return res
|
||||
|
||||
StockMove()
|
||||
|
||||
|
@ -184,7 +182,7 @@ class StockPicking(osv.osv):
|
|||
for pick in self.browse(cr, uid, ids, context=context):
|
||||
if not pick.move_lines:
|
||||
return False
|
||||
return res
|
||||
return res
|
||||
|
||||
StockPicking()
|
||||
|
||||
|
|
Loading…
Reference in New Issue