vendor_bill_editable_totals/views/account_move_views.xml
2025-11-21 18:02:20 +07:00

25 lines
1.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Inherit vendor bill form view to make price_subtotal and price_total editable -->
<record id="view_move_form_editable_totals" model="ir.ui.view">
<field name="name">account.move.form.editable.totals</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<!-- Make price_subtotal editable in vendor bill invoice lines -->
<xpath expr="//field[@name='invoice_line_ids']/tree//field[@name='price_subtotal']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="attrs">{'readonly': [('parent.state', '!=', 'draft')]}</attribute>
</xpath>
<!-- Make price_total editable in vendor bill invoice lines -->
<xpath expr="//field[@name='invoice_line_ids']/tree//field[@name='price_total']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="attrs">{'readonly': [('parent.state', '!=', 'draft')]}</attribute>
</xpath>
</field>
</record>
</data>
</odoo>