odoo/odoo#204850

Created by fw-bot
Merged at a6df58f6a1ba56b4d88fe44967ea5d3ebf782541

Statuses:

label
odoo-dev:saas-17.4-17.0-opw-4681202-default_RR_route-lase-427166-fw
head
02b6ef4df2a7e6afeedb2dcfb9811df057043f5d
merged
7 months ago by Bugfix, Lancelot Semal (lase)
odoo/odoo
17.0 #204449
saas-17.4 #204850
18.0 #205123
saas-18.1 #205144
saas-18.2 #205159
saas-18.3
saas-18.4
19.0
master #205188

[FW][FIX] stock: check product compatibility for the default RR route

Issue:

Currently, the default route set on an automatically created RR might not be set on the product.

Steps to reproduce:

  • In the settings: enable Multi-Steps Routes
  • On your warehouse set Manufacture in 3 steps
  • Create a storable product without any set route
  • Create a need for that product, for instance by creating and confirming an SO for 1 unit.
  • Inventory > Operations > Procurement > Replenishment

> A reordering rule was automatically created for your product but the manufacture route is set by default.

Cause of the issue:

Entering the replenishment tab will create orderpoints and set their default routes:
https://github.com/odoo/odoo/blob/884130330b600b4356c640cb679c2bb8fdb833a0/addons/stock/models/stock_orderpoint.py#L478-L481 However, the _set_default_route_id does not check that the route found to match a given orderpoint is actually selected on the product of the orderpoint:
https://github.com/odoo/odoo/blob/884130330b600b4356c640cb679c2bb8fdb833a0/addons/stock/models/stock_orderpoint.py#L323-L336

opw-4681202

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #204449