From d413524dc83ce564c1d98a89c083ff9dbf04fec1 Mon Sep 17 00:00:00 2001 From: "Djamel (otd)" Date: Wed, 28 Apr 2021 08:51:31 +0000 Subject: [PATCH] [FIX] stock_landed_costs: use the correct split method landed cost Steps to follow to reproduce the bug: - Install Inventory and Purchase - In the inventory settings, Enable the "Landed Costs" option - Go to Purchase > create a Service type product - In the Purchase tab > Enable "is landed cost" option and choose "by quantity" in the default split method - Go to Orders > Requests for quotation > Create a new RFQ > add Any product and confirm the order - Validate receipt of the product - Create a bill > add the Service you created at the beginning - Create Landed Costs Problem: we do not use the split method landed cost of the product, we automatically set it to "equal" opw-2465753 closes odoo/odoo#70247 X-original-commit: 5da8c593353edcae4540bec696e259031f2d60f5 Signed-off-by: William Henrotin Signed-off-by: Djamel Touati --- addons/stock_landed_costs/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/models/account_move.py b/addons/stock_landed_costs/models/account_move.py index 72c1b6b05e2..217d4e0e9bc 100644 --- a/addons/stock_landed_costs/models/account_move.py +++ b/addons/stock_landed_costs/models/account_move.py @@ -32,7 +32,7 @@ class AccountMove(models.Model): 'name': l.product_id.name, 'account_id': l.product_id.product_tmpl_id.get_product_accounts()['stock_input'].id, 'price_unit': l.currency_id._convert(l.price_subtotal, l.company_currency_id, l.company_id, l.move_id.date), - 'split_method': 'equal', + 'split_method': l.product_id.split_method_landed_cost or 'equal', }) for l in landed_costs_lines], }) action = self.env["ir.actions.actions"]._for_xml_id("stock_landed_costs.action_stock_landed_cost")