[FIX] account: fix labelling on payment's partner_bank_id

In the for view of account.payment, when creating an inbound one, the partner_bank_id field was always labeled either "Customer Bank Account" or "Vendor Bank Account". This was wrong, as this field contains the bank accounts receiving the payment, so in case of an inbound operation, it's the company account. We hence add a third possible label for it in that case.

closes odoo/odoo#83974

X-original-commit: c55f2e6aa88d01bc4f26bee7c6303f53e5bb8e48
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
This commit is contained in:
oco-odoo
2022-02-04 15:26:33 +00:00
parent f4a417b124
commit 5033a532c8
2 changed files with 16 additions and 4 deletions
+5
View File
@@ -3620,6 +3620,11 @@ msgstr ""
msgid "Company"
msgstr ""
#. module: account
#: model_terms:ir.ui.view,arch_db:account.view_account_payment_form
msgid "Company Bank Account"
msgstr ""
#. module: account
#: model:ir.model.fields,field_description:account.field_account_fiscal_position__company_country_id
msgid "Company Country"
+11 -4
View File
@@ -269,17 +269,24 @@
<field name="partner_bank_id" context="{'default_partner_id': partner_id}" string="Customer Bank Account"
attrs="{
'invisible': ['|', '|', ('show_partner_bank_account', '=', False), ('partner_type','!=','customer'), ('is_internal_transfer', '=', True)],
'invisible': ['|', '|', '|', ('show_partner_bank_account', '=', False), ('partner_type','!=','customer'), ('is_internal_transfer', '=', True), ('payment_type', '=', 'inbound')],
'required': [('require_partner_bank_account', '=', True), ('is_internal_transfer', '=', False)],
'readonly': ['|', ('state', '!=', 'draft'), ('payment_type', '=', 'inbound')],
'readonly': [('state', '!=', 'draft')],
}"/>
<field name="partner_bank_id" context="{'default_partner_id': partner_id}" string="Vendor Bank Account"
attrs="{
'invisible': ['|', '|', ('show_partner_bank_account', '=', False), ('partner_type','!=','supplier'), ('is_internal_transfer', '=', True)],
'invisible': ['|', '|', '|', ('show_partner_bank_account', '=', False), ('partner_type','!=','supplier'), ('is_internal_transfer', '=', True), ('payment_type', '=', 'inbound')],
'required': [('require_partner_bank_account', '=', True), ('is_internal_transfer', '=', False)],
'readonly': ['|', ('state', '!=', 'draft'), ('payment_type', '=', 'inbound')],
'readonly': [('state', '!=', 'draft')],
}"/>
<field name="partner_bank_id" context="{'default_partner_id': partner_id}" string="Company Bank Account" readonly="1"
attrs="{
'invisible': ['|', '|', ('show_partner_bank_account', '=', False), ('is_internal_transfer', '=', True), ('payment_type', '=', 'outbound')],
'required': [('require_partner_bank_account', '=', True), ('is_internal_transfer', '=', False)],
}"/>
<field name="destination_journal_id" context="{'default_partner_id': partner_id}"
attrs="{'invisible': [('is_internal_transfer', '=', False)],
'readonly': [('state', '!=', 'draft')], 'required': [('is_internal_transfer', '=', True),('state', '=', 'draft')]}"/>