Skip to content
Snippets Groups Projects
Commit 11c7b92f authored by Aurélien (avd)'s avatar Aurélien (avd)
Browse files

[FIX] mrp: restrict _post_process_scheduler search domain


stock.orderpoint._post_process_scheduler confirms
productions after procurements have been run.

This was introduced to avoid conflict between
procurements, conflicts that can happen e.g. in
the purchase_mrp module.

However, currently action_confirm might
also be called on done or cancelled productions.
That can happen if there are already been lots
of procurements for the same product/orderpoint,
i.e. MO with the same values have been created multiple times.

To avoid this, add ('state', '=', 'draft' in the search_domain.

opw-2666960

closes odoo/odoo#79403

Signed-off-by: default avatarArnold Moyaux <arm@odoo.com>
parent d3002116
Branches
Tags
No related merge requests found
......@@ -96,5 +96,6 @@ class StockWarehouseOrderpoint(models.Model):
self.env['mrp.production'].sudo().search([
('orderpoint_id', 'in', self.ids),
('move_raw_ids', '!=', False),
('state', '=', 'draft'),
]).action_confirm()
return super()._post_process_scheduler()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment