[FIX] mrp: manufacturing manager can unbuild an order

A manufacturing manager can unbuild an order without being an inventory manager.

The action unbuild only appears when the user is manufacturing manager.

opw:695734
This commit is contained in:
Goffin Simon
2016-12-15 09:59:31 +01:00
parent 7d19661fb6
commit 49eb6176c2
+1 -1
View File
@@ -129,7 +129,7 @@ class MrpUnbuild(models.Model):
produce_move.quantity_done = produce_move.product_uom_qty
produce_moves.move_validate()
produced_quant_ids = produce_moves.mapped('quant_ids').filtered(lambda quant: quant.qty > 0)
consume_move.quant_ids.write({'produced_quant_ids': [(6, 0, produced_quant_ids.ids)]})
consume_move.quant_ids.sudo().write({'produced_quant_ids': [(6, 0, produced_quant_ids.ids)]})
self.write({'state': 'done'})