-
- Downloads
[FIX] mrp_subcontracting_dropshipping: return to stock location
When returning a dropshipped and subcontracted product to an internal location, the received quantity of the PO line will be incorrect To reproduce the issue: 1. In Settings, enable "Storage Locations" 2. Create two storable products P_compo, P_Finished 3. Create a BoM: - Product: P_finished - Type: Subcontracting - Subcontractors: a subcontractor S - Components: 1 x P_compo 4. In Locations, edit WH/Stock: - Return location: True 5. Create and confirm a PO: - Vendor: S - Deliver To: Dropship - Drop Ship Address: a partner P - Products: 1 x P_finished 6. Validate the receipt 7. Create a return with 1 x P_finished: - Update SO/PO quantities: True - Return Location: WH/Stock 8. Validate the return 9. Go back to the PO Error: The qty received is 2, it should be 1 (it should not be 0 since the product has been returned to an internal location) In `/purchase_stock._compute_qty_received`, there is already a code to anticipate such a situation (i.e., a user who returns a dropshipped product to his stock location): https://github.com/odoo/odoo/blob/bf3c398f0644f690c64815b2b6e298aed7bedd70/addons/purchase_stock/models/purchase.py#L300-L305 However, the methods `_is_dropshipped` and `_is_dropshipped_returned` do not include the feature subcontracting + dropshipping. This is the reason why, in `_compute_qty_received`, the above condition is not respected and why we add the return stock move to the received qty. OPW-3030895 Part-of: odoo/odoo#105185
Showing
- addons/mrp_subcontracting_dropshipping/models/__init__.py 1 addition, 0 deletionsaddons/mrp_subcontracting_dropshipping/models/__init__.py
- addons/mrp_subcontracting_dropshipping/models/stock_move.py 24 additions, 0 deletionsaddons/mrp_subcontracting_dropshipping/models/stock_move.py
- addons/mrp_subcontracting_dropshipping/tests/test_purchase_subcontracting.py 17 additions, 1 deletion...acting_dropshipping/tests/test_purchase_subcontracting.py