From eca1983aef4ca7db04ddd469e1512fe93155a692 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 20 Oct 2015 08:53:40 +0200 Subject: [PATCH] [FIX] account: analytic entries onchange Broken on_change, comparing id and recordset Fixes #9144 --- addons/account/models/account_analytic_line.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py index 68ac8cbff8a..0152730f22f 100644 --- a/addons/account/models/account_analytic_line.py +++ b/addons/account/models/account_analytic_line.py @@ -27,16 +27,16 @@ class AccountAnalyticLine(models.Model): result = 0.0 prod_accounts = self.product_id.product_tmpl_id._get_product_accounts() - unit = self.product_uom_id.id + unit = self.product_uom_id account = prod_accounts['expense'] if not unit or self.product_id.uom_po_id.category_id.id != unit.category_id.id: - unit = self.product_id.uom_po_id.id + unit = self.product_id.uom_po_id ctx = dict(self._context or {}) if unit: # price_get() will respect a 'uom' in its context, in order # to return a default price for those units - ctx['uom'] = unit + ctx['uom'] = unit.id # Compute based on pricetype amount_unit = self.product_id.with_context(ctx).price_get('standard_price')[self.product_id.id]