diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-12-23 10:01:24 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-12-23 11:26:54 +0000 |
| commit | 3c285d5cd931e6f503060c6daa1823507aba7957 (patch) | |
| tree | 2209615821e2f0a98d6cfa454358162ad130083d | |
| parent | 13b6550616a3d99643b0b3de3d75f4714fd9d2f2 (diff) | |
[FIX] mrp: cancel WO from backorder when no quantity to produce.
- Have a finished Product FP (quantity 1) processed in
2 workcenters: A and B
- Create manufacturing order for FP1, raise the quantity to produce to
10
- process first workorder with lower quantity (i.e. 5)
- process second workorder with even lower quantity (i.e. 4)
- Mark MO as completed, creating a backorder
- There will be 2 backorders for the original MO.
- Process the workorder A of the last MO (record 0 quantity).
Now check the work orders report
Work orders report is showing incorrect qty for A (i.e. 6 and not 5)
The last workorder processed display Quantity 1.
This occur because the report display the quantity handled by the
workorder (1), not the actual produced quantity (0), but this is a
technical limitation of the pivot view.
A solution is to cancel the workorder when we detect a quantity to
produce equal to 0. This will also avoid users starting by accident the
workorder timer when there is no work to do.
opw-2411203
closes odoo/odoo#63728
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
| -rw-r--r-- | addons/mrp/models/mrp_production.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 1bd8d9a9b0e..eb8d5400d19 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1420,6 +1420,8 @@ class MrpProduction(models.Model): wo.qty_producing = 1 else: wo.qty_producing = wo.qty_remaining + if wo.qty_producing == 0: + wo.action_cancel() production.name = self._get_name_backorder(production.name, production.backorder_sequence) |
