[FIX] account_reconcile_oca: Show manual amount in the right currency

pull/808/head
Enric Tobella 2023-09-06 22:42:03 +02:00 committed by Jordi Ballester Alomar
parent 387bf6ff33
commit 839d71d162
2 changed files with 9 additions and 1 deletions

View File

@ -66,7 +66,12 @@ class AccountBankStatementLine(models.Model):
domain=[("rule_type", "=", "writeoff_button")], domain=[("rule_type", "=", "writeoff_button")],
) )
manual_name = fields.Char(store=False, default=False, prefetch=False) manual_name = fields.Char(store=False, default=False, prefetch=False)
manual_amount = fields.Monetary(store=False, default=False, prefetch=False) manual_amount = fields.Monetary(
store=False, default=False, prefetch=False, currency_field="manual_currency_id"
)
manual_currency_id = fields.Many2one(
"res.currency", readonly=True, store=False, prefetch=False
)
manual_original_amount = fields.Monetary( manual_original_amount = fields.Monetary(
default=False, store=False, prefetch=False, readonly=True default=False, store=False, prefetch=False, readonly=True
) )
@ -240,6 +245,7 @@ class AccountBankStatementLine(models.Model):
"manual_move_type": False, "manual_move_type": False,
"manual_kind": False, "manual_kind": False,
"manual_original_amount": False, "manual_original_amount": False,
"manual_currency_id": False,
"analytic_distribution": False, "analytic_distribution": False,
} }
) )
@ -247,6 +253,7 @@ class AccountBankStatementLine(models.Model):
else: else:
self.manual_account_id = line["account_id"][0] self.manual_account_id = line["account_id"][0]
self.manual_amount = line["amount"] self.manual_amount = line["amount"]
self.manual_currency_id = line["currency_id"]
self.manual_name = line["name"] self.manual_name = line["name"]
self.manual_partner_id = ( self.manual_partner_id = (
line.get("partner_id") and line["partner_id"][0] line.get("partner_id") and line["partner_id"][0]

View File

@ -255,6 +255,7 @@
string="Amount" string="Amount"
attrs="{'readonly': ['|', ('manual_reference', '=', False), ('is_reconciled', '=', True)]}" attrs="{'readonly': ['|', ('manual_reference', '=', False), ('is_reconciled', '=', True)]}"
/> />
<field name="manual_currency_id" invisible="1" />
<field name="manual_original_amount" invisible="1" /> <field name="manual_original_amount" invisible="1" />
<field name="manual_move_type" invisible="1" /> <field name="manual_move_type" invisible="1" />
<label <label