view_res_partner.xml 2.02 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
Copyright (C) 2016-Today GRAP (http://www.lalouve.net)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->

<odoo>

    <record id="view_res_partner_form" model="ir.ui.view">
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="point_of_sale.view_partner_property_form"/>
        <field name="arch" type="xml">
            <field name="barcode" position="before">
                <field name="barcode_rule_id"
                    domain="[('generate_model', '=', 'res.partner')]"
                    groups="barcodes_generate.generate_barcode" colspan="2"/>
                <field name="generate_type" invisible="1" />
                <field name="barcode_base" attrs="{
                    'invisible': [('barcode_rule_id', '=', False)],
                    'readonly': [('generate_type', '!=', 'manual')]}"
                    groups="barcodes_generate.generate_barcode" colspan="2"/>
                <button name="generate_base" type="object" string="Generate Base (Using Sequence)" attrs="{'invisible': ['|',
                    ('generate_type', '!=', 'sequence'),
                    ('barcode_base', '!=', 0)]}"
                    groups="barcodes_generate.generate_barcode" colspan="2"/>
            </field>

            <field name="barcode" position="attributes">
                <attribute name="attrs">{'readonly': [('generate_type', '=', 'sequence')]}</attribute>
            </field>

            <field name="barcode" position="after">
                <button name="generate_barcode" type="object" string="Generate Barcode (Using Barcode Rule)"
                    attrs="{'invisible': ['|',
                            ('barcode_rule_id', '=', False),
                            ('barcode_base', '=', 0)]}"
                    groups="barcodes_generate.generate_barcode" colspan="2"/>
            </field>
        </field>
    </record>

</odoo>