[IMP] mrp: pre_mark_as_done validate serials and workorders

When marking an MO as done in the shop floor, the pre_mark_done method
is used to determine if there are any issues before putting the MO in
the 5 second validation queue.
However, there were two cases that were not yet caught here:
1. Pending quality checks on a workorder
2. Duplicate serial number on the final product
This commit adresses both of these cases.

closes odoo/odoo#137535

Task: 3456827 (nr 28)
Related: odoo/enterprise#48379
Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit is contained in:
Pieter Claeys (clpi)
2023-10-19 14:47:23 +00:00
committed by svs-odoo
parent ac9a02d14e
commit 6e20ea5f12
+1 -2
View File
@@ -1929,8 +1929,6 @@ class MrpProduction(models.Model):
self.workorder_ids._action_confirm()
def button_mark_done(self):
self._button_mark_done_sanity_checks()
res = self.pre_button_mark_done()
if res is not True:
return res
@@ -2012,6 +2010,7 @@ class MrpProduction(models.Model):
return action
def pre_button_mark_done(self):
self._button_mark_done_sanity_checks()
for production in self:
if float_is_zero(production.qty_producing, precision_rounding=production.product_uom_id.rounding):
production._set_quantities()