[FIX] mrp: Kit in manufacturing

Steps to reproduce the bug:

- Create a MO with a product with a normal bom B
- Save the MO
- Change the type of B to phantom
- Try to produce the MO

Bug:

It was impossible to cancel or confirm the MO.
It's not allowed to produce a MO with phantom bom.

opw:2061958

closes odoo/odoo#36329

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2019-09-03 07:38:18 +00:00
parent 149d782a0e
commit a9bb669487
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -4133,6 +4133,12 @@ msgstr ""
msgid "You cannot delete an unbuild order if the state is 'Done'."
msgstr ""
#. module: mrp
#: code:addons/mrp/models/mrp_production.py:533
#, python-format
msgid "You cannot produce a MO with a bom kit product."
msgstr ""
#. module: mrp
#: code:addons/mrp/wizard/mrp_product_produce.py:82
#, python-format
+2
View File
@@ -529,6 +529,8 @@ class MrpProduction(models.Model):
@api.multi
def open_produce_product(self):
self.ensure_one()
if self.bom_id.type == 'phantom':
raise UserError(_('You cannot produce a MO with a bom kit product.'))
action = self.env.ref('mrp.act_mrp_product_produce').read()[0]
return action