04.01.26
This commit is contained in:
@@ -138,11 +138,13 @@ class ValuationBase(ModelSQL):
|
||||
amount = round(price * qty * Decimal(sign), 4)
|
||||
base_amount = amount
|
||||
currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id
|
||||
company_currency = sale_line.sale.company.currency if sale_line else line.purchase.company.currency
|
||||
rate = Decimal(1)
|
||||
if line.purchase.company.currency != currency:
|
||||
with Transaction().set_context(date=Date.today()):
|
||||
base_amount = Currency.compute(currency,amount, line.purchase.company.currency)
|
||||
rate = round(amount / base_amount,6)
|
||||
base_amount = Currency.compute(currency,amount, company_currency)
|
||||
if base_amount and amount:
|
||||
rate = round(amount / base_amount,6)
|
||||
|
||||
values.update({
|
||||
'price': round(price, 4),
|
||||
|
||||
Reference in New Issue
Block a user