diff options
| author | William Henrotin <whe@odoo.com> | 2019-10-22 14:46:39 +0000 |
|---|---|---|
| committer | William Henrotin <whe@odoo.com> | 2019-11-22 12:39:51 +0000 |
| commit | e1f518bb83ccaa2abf08bc870bc1c7345e85971c (patch) | |
| tree | b314b92e458f1194642cc15de4b6fda26ed52798 /addons/mrp/wizard | |
| parent | 9412b749864e057fa3276873f4bc8873c1d144e1 (diff) | |
[IMP] mrp: add components in workorders
This commit extend the flexible consumption. On the workorder form view.
It's now possible to add directly new workorder line with any product
(even one not in any BoM line). For those new wo line. A confirmed stock
move is create in the record_production step.
Task : 2082448
Diffstat (limited to 'addons/mrp/wizard')
| -rw-r--r-- | addons/mrp/wizard/mrp_product_produce.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index 27a20724746..5a0601f5ec9 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -109,34 +109,6 @@ class MrpProductProduce(models.TransientModel): # Check all the product_produce line have a move id (the user can add product # to consume directly in the wizard) for line in self._workorder_line_ids(): - if not line.move_id: - # Find move_id that would match - if line.raw_product_produce_id: - moves = self.move_raw_ids - else: - moves = self.move_finished_ids - move_id = moves.filtered(lambda m: m.product_id == line.product_id and m.state not in ('done', 'cancel')) - if not move_id: - # create a move to assign it to the line - if line.raw_product_produce_id: - values = { - 'name': self.production_id.name, - 'reference': self.production_id.name, - 'product_id': line.product_id.id, - 'product_uom': line.product_uom_id.id, - 'location_id': self.production_id.location_src_id.id, - 'location_dest_id': line.product_id.property_stock_production.id, - 'raw_material_production_id': self.production_id.id, - 'group_id': self.production_id.procurement_group_id.id, - 'origin': self.production_id.name, - 'state': 'confirmed', - 'company_id': self.production_id.company_id.id, - } - else: - values = self.production_id._get_finished_move_value(line.product_id.id, 0, line.product_uom_id.id) - move_id = self.env['stock.move'].create(values) - line.move_id = move_id.id - line._check_line_sn_uniqueness() # because of an ORM limitation (fields on transient models are not # recomputed by updates in non-transient models), the related fields on |
