summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2016-07-06 16:48:51 +0200
committerGoffin Simon <sig@odoo.com>2016-07-07 11:31:54 +0200
commita082ec6aea69b9153e6df65ebf7a07e458f1620f (patch)
tree916757645767223db2e21a98d0f489f0f8deed21
parenta1c3fe12917621a8f95fd5088d134e170f779228 (diff)
[FIX] sale: Expenses in multi currency
Steps to reproduce: -Set your company in USD -Create a SaleOrder with a pricelist in EUR -Create an expense in USD, with the analytic account of the SO -Confirm the expense and post journal entries. Bug: The unit price of the new SO line was wrong: it was stil in USD as in the expense. Expected behavior: The price unit must be converted in EUR opw:682378
-rw-r--r--addons/sale/sale_analytic.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/sale/sale_analytic.py b/addons/sale/sale_analytic.py
index 9261c5c4208..9b4f2e789be 100644
--- a/addons/sale/sale_analytic.py
+++ b/addons/sale/sale_analytic.py
@@ -43,8 +43,9 @@ class AccountAnalyticLine(models.Model):
if self.unit_amount == 0.0:
return 0.0
price_unit = abs(self.amount / self.unit_amount)
- if self.currency_id and self.currency_id != order.currency_id:
- price_unit = self.currency_id.compute(price_unit, order.currency_id)
+ currency_id = self.currency_id or self.account_id.currency_id
+ if currency_id and currency_id != order.currency_id:
+ price_unit = currency_id.compute(price_unit, order.currency_id)
return price_unit
def _get_sale_order_line_vals(self):