-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] sale_stock_margin: convert purchase_price
When confirming a SO, if the costing method of a product's category is not `Standard' and if the SO's currency is different from the company's currency, the cost of the product won't be converted to the SO's currency To reproduce the error: 1. In Settings, enable: - Margins - Multi-Currencies 2. Create a product category PC: - Costing Method: FIFO 3. Create a product P: - Product Type: Storable - Product Category: PC - Sales Price: 200 - Cost: 100 4. Update P's quantity to 1 5. Create a pricelist PL: - Currency: EUR 6. Create a SO: - Pricelist: PL - Order Lines: - 1 x P 7. Add field "Cost" to the tree view of the order lines - The value is correctly converted 8. Confirm the SO Error: The cost of the order line is now 100€. This is actually the USD cost, it should be converted This code applies the same conversion as when the cost method is standard: https://github.com/odoo/odoo/blob/8a8ff03f6111f377bcd9c2b0f584c450b82a4182/addons/sale_margin/models/sale_order.py#L42-L48 OPW-2563442 closes odoo#73545 Signed-off-by: Rémy Voet <[email protected]>
- Loading branch information
Showing
2 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters