odoo/odoo#191529

Created by Bugfix, Djamel Touati (otd)
Merged at efd386c41f32edafb0e62a1b0ec3cffbb2953b6a

Statuses:

label
odoo-dev:saas-17.2-opw-4415565-stock-fix-lot-branch-company-otd
head
23eca1b8a860426207d22c3e3f430c1bdd33dcc2
merged
5 months ago by Logistics, Quentin Wolfs (quwo)
odoo/odoo
saas-17.2 #191529
saas-17.4 #194172
18.0 #194196
saas-18.1 #194215
saas-18.2
saas-18.3
master #195509

[FIX] stock: allow lot to be used by branches

Steps to reproduce the bug:
- Create a “Company A” and a “ branch 1” linked to this company
- Create a storable product “P1”:
- limited to Company A

  • Select only the branch 1 as current company
  • Create a receipt for one unit of P1
  • Mark it as to do.
  • Try to create a lot or use lot created in Company A

Problem:
An acces error is raised:
Incompatible companies on records: - 'Product B' belongs to company 'Branch X' and 'Lot/Serial Number' (lot_id: 'sn_test') belongs to another company.

opw-4415565