addons-cm/barcode_generator_partner/views/view_res_partner.xml

63 lines
2.4 KiB
XML

<?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="barcode" position="before">
<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"
attrs="{
'invisible': [('barcode_rule_id', '=', False)],
'readonly': [('generate_type', '!=', 'manual')]}"
groups="barcodes_generator_abstract.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_generator_abstract.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_generator_abstract.generate_barcode"
colspan="2"
/>
</field>
</field>
</record>
</odoo>