line/splitline: optimize value-update on create/write

This commit is contained in:
Frederik Jaeckel 2023-01-15 23:05:43 +01:00
parent 82ae7d7bca
commit 3b289b7944
4 changed files with 97 additions and 34 deletions

View file

@ -59,14 +59,12 @@ class SecondCurrencyMixin:
Cashbook = pool.get('cashbook.book')
IrDate = pool.get('ir.date')
#cashbook = values.get('cashbook', None)
booktransf = values.get('booktransf', None)
amount = values.get('amount', None)
amount_2nd_currency = values.get('amount_2nd_currency', None)
if (amount is not None) and (booktransf is not None):
if amount_2nd_currency is None:
#cashbook = Cashbook(cashbook)
booktransf = Cashbook(booktransf)
if from_currency.id != booktransf.currency.id:
with Transaction().set_context({