addons-cm/account_invoice_triple_discount_readonly/views/account_move_view.xml

28 lines
995 B
XML

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Make discount field readonly in invoice lines -->
<record id="invoice_triple_discount_readonly" model="ir.ui.view">
<field name="name">account.invoice.triple.discount.readonly</field>
<field name="model">account.move</field>
<field
name="inherit_id"
ref="account_invoice_triple_discount.invoice_triple_discount_form_view"
/>
<field name="arch" type="xml">
<xpath
expr="//field[@name='invoice_line_ids']//tree//field[@name='discount']"
position="attributes"
>
<attribute name="readonly">1</attribute>
</xpath>
<xpath
expr="//field[@name='invoice_line_ids']//form//field[@name='discount']"
position="attributes"
>
<attribute name="readonly">1</attribute>
</xpath>
</field>
</record>
</odoo>