[FIX] mrp: fix _split_productions overloading

add missing _set_consumed_qty parameter in _split_productions overloading
fix typo in cancel_remaining_qty parameter

closes odoo/odoo#85824

Task: 2783912
X-original-commit: 1071e74d58c14c3a32c4d19669b0dd8426b14f1a
Related: odoo/enterprise#24995
Signed-off-by: Arnold Moyaux <arm@odoo.com>
This commit is contained in:
JF Aubert
2022-03-04 13:12:56 +00:00
parent 83859de33c
commit 723b642713
+2 -2
View File
@@ -1493,7 +1493,7 @@ class MrpProduction(models.Model):
'orderpoint_id': self.orderpoint_id.id,
}
def _split_productions(self, amounts=False, cancel_remaning_qty=False, set_consumed_qty=False):
def _split_productions(self, amounts=False, cancel_remaining_qty=False, set_consumed_qty=False):
""" Splits productions into productions smaller quantities to produce, i.e. creates
its backorders.
@@ -1515,7 +1515,7 @@ class MrpProduction(models.Model):
amounts[production] = _default_amounts(production)
continue
total_amount = sum(mo_amounts)
if total_amount < production.product_qty and not cancel_remaning_qty:
if total_amount < production.product_qty and not cancel_remaining_qty:
amounts[production].append(production.product_qty - total_amount)
elif total_amount > production.product_qty or production.state in ['done', 'cancel']:
raise UserError(_("Unable to split with more than the quantity to produce."))