IMP purchase_by_sale_history_mrp Improve messaging (include product id) when multiple BoMs prevent wizard.

This commit is contained in:
Jared Kipe
2020-03-25 12:16:26 -07:00
parent 61b8a5093f
commit 8a5538af56

View File

@@ -31,7 +31,8 @@ class PurchaseBySaleHistory(models.TransientModel):
product_ids_dict = {}
for pid, ratio in product_ids:
if pid in product_ids_dict:
raise UserError('You cannot have two identical finished goods being created from different ratios.')
raise UserError('You cannot have two identical finished goods being created '
'from different ratios/BoMs. Finished Product ID: %s' % (pid, ))
product_ids_dict[pid] = {'ratio': ratio}
history = self._sale_history(product_ids_dict.keys())