diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 8ad668e14f8..7cdd24a710c 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -657,15 +657,13 @@ class mrp_production(osv.osv): @return: True """ move_obj = self.pool.get('stock.move') - self.write(cr, uid, ids, {'state': 'ready'}, context=context) + self.write(cr, uid, ids, {'state': 'ready'}) for (production_id,name) in self.name_get(cr, uid, ids): - production = self.browse(cr, uid, production_id, context=context) - if not production.move_prod_id and not production.move_lines: - move_obj.write(cr, uid, [i.id for i in production.move_created_ids], {'state': 'assigned'}, context=context) + production = self.browse(cr, uid, production_id) if production.move_prod_id and production.move_prod_id.location_id.id != production.location_dest_id.id: move_obj.write(cr, uid, [production.move_prod_id.id], - {'location_id': production.location_dest_id.id}, context=context) + {'location_id': production.location_dest_id.id}) return True def action_production_end(self, cr, uid, ids, context=None): @@ -879,7 +877,6 @@ class mrp_production(osv.osv): 'procure_method': production_line.product_id.procure_method, 'move_id': shipment_move_id, 'company_id': production.company_id.id, - 'sale_line_id': production.move_prod_id and production.move_prod_id.sale_line_id and production.move_prod_id.sale_line_id.id }) wf_service.trg_validate(uid, procurement_order._name, procurement_id, 'button_confirm', cr) return procurement_id diff --git a/addons/mrp/mrp_workflow.xml b/addons/mrp/mrp_workflow.xml index 93dacc15f3c..a0943628fc8 100644 --- a/addons/mrp/mrp_workflow.xml +++ b/addons/mrp/mrp_workflow.xml @@ -72,14 +72,6 @@ picking_id and picking_id.state=='done' - - - - - button_produce_done - not move_lines and test_production_done() - - diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 789ca876242..60a50c90d1e 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -147,18 +147,6 @@ class StockMove(osv.osv): production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]}) res.append(new_move) return res - - def action_done(self, cr, uid, ids, context=None): - res = super(StockMove, self).action_done(cr, uid, ids, context=context) - 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])], context=context) - if production_ids: - 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) - return res StockMove() @@ -176,13 +164,6 @@ class StockPicking(osv.osv): for move in move_obj.browse(cr, uid, move_ids): todo.extend(move_obj._action_explode(cr, uid, move)) return list(set(todo)) - - def test_cancel(self, cr, uid, ids, context=None): - res = super(StockPicking, self).test_cancel(cr, uid, ids, context=context) - for pick in self.browse(cr, uid, ids, context=context): - if not pick.move_lines: - return False - return res StockPicking()