account_journal.xml 1.15 KB
Newer Older
François C. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<!-- FIX of the 'account' module: on the form view of a bank journal,
allow to link to an existing bank account -->
<record id="view_account_journal_form" model="ir.ui.view">
    <field name="name">fix_bank_account_selection.account_journal.form</field>
    <field name="model">account.journal</field>
    <field name="inherit_id" ref="account.view_account_journal_form"/>
    <field name="arch" type="xml">
        <field name="bank_acc_number" position="attributes">
            <attribute name="invisible">1</attribute>
        </field>
        <field name="bank_acc_number" position="before">
            <field name="company_partner_id" invisible="1"/>
            <field name="bank_account_id" domain="[('partner_id', '=', company_partner_id)]"/>
        </field>
        <!-- better when related fields are readonly, otherwise the user
        doesn't understand that he is changing the bank_id on the underlying
        res.partner.bank object -->
        <field name="bank_id" position="attributes">
            <attribute name="readonly">1</attribute>
        </field>
    </field>
</record>

</data>
</odoo>