From ab1ccfada5a93c9557d4cda152e8ed866c849cc9 Mon Sep 17 00:00:00 2001 From: gawa-odoo Date: Mon, 20 Mar 2023 14:15:43 +0000 Subject: [PATCH] [FIX] sale: distribution with same account in account and distrib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Activate analytic accounting - Create a Sale Order, with an analytic account for the whole order - Add a line with a distribution containing the same account (100%) - Create Invoice From this Order => The distribution on the account for the invoice is of 100% and not 200% (the sum of the order's account and distribution). The problem is that on the dict that we're returning, the key is a string closes odoo/odoo#116617 X-original-commit: 9ecf263d4124b186b55e50ab025acb7541043d3a Signed-off-by: William André (wan) Signed-off-by: Wala Gauthier (gawa) --- addons/sale/models/sale_order_line.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/models/sale_order_line.py b/addons/sale/models/sale_order_line.py index 6cf21de5819..b5bb9c1c334 100644 --- a/addons/sale/models/sale_order_line.py +++ b/addons/sale/models/sale_order_line.py @@ -1102,6 +1102,7 @@ class SaleOrderLine(models.Model): if self.analytic_distribution and not self.display_type: res['analytic_distribution'] = self.analytic_distribution if analytic_account_id and not self.display_type: + analytic_account_id = str(analytic_account_id) if 'analytic_distribution' in res: res['analytic_distribution'][analytic_account_id] = res['analytic_distribution'].get(analytic_account_id, 0) + 100 else: