[FIX] account: multi-currency reconciliation
Reconcile the following entries :
D C
Amount currency
3.655,52€ +3.872,45$
3.436,80€ -3.872,45$
What Odoo does when I reconcile the 2 entries above using the
"Reconcile" button:
D C
Amount currency
3.655,52€ +3.872,45$
3.436,80€ -3.872,45$
0€ 218,72€ -236,61$
0€ 0€
+236,61$
What Odoo should do :
D C
Amount currency
3.655,52€ +3.872,45$
3.436,80€ -3.872,45$
0€ 218,72€ 0$
opw-687481
This commit is contained in:
@@ -1071,10 +1071,13 @@ class AccountMoveLine(models.Model):
|
||||
# the provided values were not already multi-currency
|
||||
if account.currency_id and 'amount_currency' not in vals and account.currency_id.id != account.company_id.currency_id.id:
|
||||
vals['currency_id'] = account.currency_id.id
|
||||
ctx = {}
|
||||
if 'date' in vals:
|
||||
ctx['date'] = vals['date']
|
||||
vals['amount_currency'] = account.company_id.currency_id.with_context(ctx).compute(amount, account.currency_id)
|
||||
if self._context.get('skip_full_reconcile_check') == 'amount_currency_excluded':
|
||||
vals['amount_currency'] = 0.0
|
||||
else:
|
||||
ctx = {}
|
||||
if 'date' in vals:
|
||||
ctx['date'] = vals['date']
|
||||
vals['amount_currency'] = account.company_id.currency_id.with_context(ctx).compute(amount, account.currency_id)
|
||||
if not ok:
|
||||
raise UserError(_('You cannot use this general account in this journal, check the tab \'Entry Controls\' on the related journal.'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user