Files
bank-payment/account_payment_mode/views/res_partner.xml
Jon Zaballa 3ec955ea74 [11.0][FIX] account_payment_mode res.partner view banks group attribute
Description of the issue/feature this PR addresses:

The modules adds `{'invisible': [('parent_id', '!=', False)]}` attribute
to `banks` group on res.partner form view. The rationale for this,
according to a comment on the view itself is:
> ... there is a domain on the 'partner_id' field of res.partner.bank
(base module) which prevents the selection of a contact

However, the domain the comment refers to is
`['|', ('is_company', '=', True), ('parent_id', '=', False)]`
So, I think the domain for the group to be invisible should be
`[('parent_id', '!=', False), ('is_company', '=', False)]`. In addition,
a parent that is a company is always its own commercial partner. So we
should have access to its payment information.

Current behavior before PR:

Bank and mandates information is hidden when a partner is a company and
has a parent.

Desired behavior after PR is merged:

Banking information should be visible if a partner is a company.
2019-01-28 11:46:02 +01:00

22 lines
775 B
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Avoid creation of bank accounts linked to contacts.
Note that, when you use the res.partner.bank menu entry,
there is a domain on the 'partner_id' field of res.partner.bank (base module)
which prevents the selection of a contact -->
<record id="partner_view_buttons" model="ir.ui.view">
<field name="name">account_payment_mode.res_partner_form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.partner_view_buttons"/>
<field name="arch" type="xml">
<group name="banks" position="attributes">
<attribute name="attrs">{'invisible': [('parent_id', '!=', False), ('is_company', '=', False)]}</attribute>
</group>
</field>
</record>
</odoo>