Method _is_purchase_return had a complex check intended to detect
subcontract return move. This Check would incorrectly pass for
subcontract move when the destination location (input) does not belong
to the customer warehouse.
To fix this issue, we can check the field StockMove.is_subcontract,
however this field is only available if mrp_subcontracting is installed.
Furthermore, the check itself make no sens in purchase_stock if the
module mrp_subcontracting is not install Hence, we can move this check
to mrp_subcontracting_purchase.
With Purchase & Mrp Subcontracting installed:
- Create Component C, consumable
- Create Product P, storable, Set Vendor V under Purchase Tab
- Create BOM for P, subcontracted with Vendor V, and C as component
- In the Warehouse, set 2 steps reception
- Set Input parent location to 'Physical Location'
- Create PO to vendor V, product P, confirm, receive Product
=> Received Qty for P in PO show 0
OPW-3216011
X-original-commit: bf666d33af4ac32563e159cb6e79483d6f37b3d6
Part-of: odoo/odoo#147344