[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user