Merge dev from main #1

Merged
admin merged 25 commits from main into dev 2026-01-05 13:03:46 +00:00
Showing only changes of commit 5111265019 - Show all commits

View File

@@ -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({