[IMP] account: bank account journals form: hide related fields when bank_account_id isn't set

Showing these fields does not actually make sense when bank_account_id isn't set as well, since setting them and saving will result in them losing their value (as they're actually related on an empty field). We need to hide them while bank_account_id is not set.

closes odoo/odoo#48842

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
oco-odoo
2020-04-02 09:07:50 +00:00
parent c4636fe71b
commit 70da147e9b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -275,7 +275,7 @@
<group>
<field name="company_partner_id" invisible="1"/>
<field name="bank_account_id" context="{'default_partner_id': company_partner_id, 'form_view_ref': 'account.view_company_partner_bank_form'}"/>
<field name="bank_id"/>
<field name="bank_id" attrs="{'invisible': [('bank_account_id', '=', False)]}"/>
</group>
<group >
<field name="bank_statements_source" widget="radio" attrs="{'required': [('type', '=', 'bank')]}" groups="account.group_account_readonly"/>
+1 -1
View File
@@ -45,7 +45,7 @@
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='bank_account_id']" position="after">
<field name="l10n_ch_postal" attrs="{'invisible': [('type', 'not in', ['bank', 'cash'])]}"/>
<field name="l10n_ch_postal" attrs="{'invisible': [('bank_account_id', '=', False)]}"/>
</xpath>
</field>
</record>