diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 4b19ae6b824092e7151ee753a0269cf3386d1f1d..25046a68ed61957a5b251afcfc14838617731505 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -918,7 +918,7 @@ class account_voucher(osv.osv): currency_id = journal.currency.id else: currency_id = journal.company_id.currency_id.id - vals['value'].update({'currency_id': currency_id}) + vals['value'].update({'currency_id': currency_id, 'payment_rate_currency_id': currency_id}) #in case we want to register the payment directly from an invoice, it's confusing to allow to switch the journal #without seeing that the amount is expressed in the journal currency, and not in the invoice currency. So to avoid #this common mistake, we simply reset the amount to 0 if the currency is not the invoice currency. diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 2dd53832529dad16f2c7af9ce779bd074d84dc48..20ac768258c0083bfffb08cc6273a0d861cd0697 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -222,6 +222,7 @@ <field name="pay_now" invisible="1"/> <field name="type" invisible="True"/> + <field name="payment_rate_currency_id" invisible="1"/> <group> <group> <field name="partner_id" domain="[('supplier','=',True)]" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}" />