Merge dev from main #1
@@ -138,10 +138,12 @@ class ValuationBase(ModelSQL):
|
|||||||
amount = round(price * qty * Decimal(sign), 4)
|
amount = round(price * qty * Decimal(sign), 4)
|
||||||
base_amount = amount
|
base_amount = amount
|
||||||
currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id
|
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)
|
rate = Decimal(1)
|
||||||
if line.purchase.company.currency != currency:
|
if line.purchase.company.currency != currency:
|
||||||
with Transaction().set_context(date=Date.today()):
|
with Transaction().set_context(date=Date.today()):
|
||||||
base_amount = Currency.compute(currency,amount, line.purchase.company.currency)
|
base_amount = Currency.compute(currency,amount, company_currency)
|
||||||
|
if base_amount and amount:
|
||||||
rate = round(amount / base_amount,6)
|
rate = round(amount / base_amount,6)
|
||||||
|
|
||||||
values.update({
|
values.update({
|
||||||
|
|||||||
Reference in New Issue
Block a user