<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2016-Today: GRAP (http://www.grap.coop)
Copyright (C) 2016-Today La Louve (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="base.view_partner_form"/>
        <field name="arch" type="xml">
            <field name="category_id" position="before">
                <field name="barcode"/>
                <field name="barcode_rule_id"
                       domain="[('generate_model', '=', 'res.partner')]"
                       groups="barcodes_generator_abstract.generate_barcode" colspan="2"/>
                <field name="generate_type" invisible="1"/>
                <field name="barcode_base"
                       groups="barcodes_generator_abstract.generate_barcode" colspan="2"
                       invisible="barcode_rule_id == False"
                       readonly="generate_type != 'manual'"/>
                <button name="generate_base" type="object" string="Generate Base (Using Sequence)"
                        groups="barcodes_generator_abstract.generate_barcode" colspan="2"
                        invisible="generate_type != 'sequence' or barcode_base != 0"
                        readonly="generate_type == 'sequence'"/>
            </field>
            <field name="barcode" position="after">
                <button name="generate_barcode" type="object" string="Generate Barcode (Using Barcode Rule)"
                        groups="barcodes_generator_abstract.generate_barcode" colspan="2" invisible="barcode_rule_id == False
                    or barcode_base == 0"/>
            </field>
        </field>
    </record>

</odoo>
