summaryrefslogtreecommitdiff
path: root/addons/stock/models/procurement.py
diff options
context:
space:
mode:
authorArnold Moyaux <arm@odoo.com>2018-03-05 11:23:55 +0100
committerArnold Moyaux <arm@odoo.com>2018-03-05 16:07:01 +0100
commit476b45eb9cec59c24f330ec7e784feaeca26f0ae (patch)
tree176086e87a2a1008f1d5f2cd448df4026a649820 /addons/stock/models/procurement.py
parent599f6a762e91dd08d093243684183cdb9a3b3513 (diff)
[FIX] stock: scheduler run cancel MTO picking
Use case to reproduce: - Create a sale order with a stockable product. - Confirm the sale order. - Validate the pick. - Validate the pack. - Cancel the OUT. - Run the stock scheduler. -> Picking are created from pick and ship. The scheduler should not try to create missing pickings for broken move's chain. Since v11, it's not possible to create a partial mto chain that means if a chain is broken it's due to a manual action from a user and thus we won't automatically repair what he cancelled on purpose. That's why we won't create a new move out in this case. It also don't make sense to recreate a new mto chain from a cancelled picking. Thus we had a condition in domain in order to only take moves that make sense. Based on preliminary work from Florent de Labarre <florent.mirieu@gmail.com> Closes #23441 #23458 OPW-1820226
Diffstat (limited to 'addons/stock/models/procurement.py')
-rw-r--r--addons/stock/models/procurement.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py
index 1a20a7dd626..7aaf942b0e9 100644
--- a/addons/stock/models/procurement.py
+++ b/addons/stock/models/procurement.py
@@ -229,7 +229,7 @@ class ProcurementGroup(models.Model):
@api.model
def _get_exceptions_domain(self):
- return [('procure_method', '=', 'make_to_order'), ('move_orig_ids', '=', False)]
+ return [('procure_method', '=', 'make_to_order'), ('move_orig_ids', '=', False), ('state', 'not in', ('cancel', 'done', 'draft'))]
@api.model
def _run_scheduler_tasks(self, use_new_cursor=False, company_id=False):