Steps to reproduce:
a. Setup 2 companies (parent-child) and set current company to child
b. Install manufacturing and configure advanced planning (workorders)
c. Define a product for manufacturing (setup product, bom, components, etc.)
d. Define a simple routing for manufacturing - 2 steps (sufficient)
e. Create a new MO, and confirm
f. Click Plan
Current behavior: Error
Some records are incompatible with the company of the Work Order.
Incompatibilities:
Fields: leave_id
Record ids: 32
Expected behavior:
No errors.
Code snippet in debugger to highlight issue in line 3175 of models.py.
-> elif not (corecord.company_id <= company):
(Pdb) corecord.company_id
res.company(1,)
(Pdb) company
res.company(4,)
(Pdb) corecord.company_id <= company
False
(Pdb) corecord.company_id.id <= company.id
True
The way the code is written, it is doing a comparison on two objects that returns a False. In reality, the check should be between the two ids -- which would have returned True.
Impacted versions: 13.0
Steps to reproduce: a. Setup 2 companies (parent-child) and set current company to child b. Install manufacturing and configure advanced planning (workorders) c. Define a product for manufacturing (setup product, bom, components, etc.) d. Define a simple routing for manufacturing - 2 steps (sufficient) e. Create a new MO, and confirm f. Click Plan
Current behavior: Error
Some records are incompatible with the company of the Work Order.
Incompatibilities: Fields: leave_id Record ids: 32
Expected behavior: No errors.
Code snippet in debugger to highlight issue in line 3175 of models.py.
-> elif not (corecord.company_id <= company): (Pdb) corecord.company_id res.company(1,) (Pdb) company res.company(4,) (Pdb) corecord.company_id <= company False (Pdb) corecord.company_id.id <= company.id True
The way the code is written, it is doing a comparison on two objects that returns a False. In reality, the check should be between the two ids -- which would have returned True.