[FIX] sale: distribution with same account in account and distrib

- 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) <wan@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
This commit is contained in:
gawa-odoo
2023-03-27 09:39:58 +02:00
parent 5a5ada1dc8
commit ab1ccfada5
+1
View File
@@ -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: