summaryrefslogtreecommitdiff
path: root/addons/account/models/account_analytic_line.py
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2019-02-06 10:24:09 +0000
committerNicolas Martinelli <nim@odoo.com>2019-02-06 10:27:59 +0000
commitc7c938996f783cbb187697b9f36c8359b2c4733f (patch)
treec3453e46152879ba2d80159a35a3bbc7fe3992b6 /addons/account/models/account_analytic_line.py
parentd89f4d6ec26806389922351eb8e575754b3f60e0 (diff)
[FIX] account: analytic cost
- Set a cost of 12.34 for product P - Create manually a new analytic entry - Choose product P - Set desired quantity The analytic amount is set to 12.00. This is because `move_id` is empty, therefore `currency_id` is empty as well and `decimal_places` is zero opw-1924184 closes odoo/odoo#30869
Diffstat (limited to 'addons/account/models/account_analytic_line.py')
-rw-r--r--addons/account/models/account_analytic_line.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_analytic_line.py b/addons/account/models/account_analytic_line.py
index 20b44c04dbb..5f001ad34dd 100644
--- a/addons/account/models/account_analytic_line.py
+++ b/addons/account/models/account_analytic_line.py
@@ -44,7 +44,7 @@ class AccountAnalyticLine(models.Model):
# Compute based on pricetype
amount_unit = self.product_id.price_compute('standard_price', uom=unit)[self.product_id.id]
amount = amount_unit * self.unit_amount or 0.0
- result = round(amount, self.currency_id.decimal_places) * -1
+ result = round(amount, self.currency_id.decimal_places if self.currency_id else 2) * -1
self.amount = result
self.general_account_id = account
self.product_uom_id = unit