hr_expense_account_split/views/product_views.xml
2026-03-31 17:25:04 +07:00

34 lines
1.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_product_expense_form_view_inherit_split" model="ir.ui.view">
<field name="name">product.product.expense.form.split</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="hr_expense.product_product_expense_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_account_expense_id']" position="attributes">
<attribute name="string">Default Expense Account</attribute>
<attribute name="help">Fallback account used if no employee or company specific account is set.</attribute>
</xpath>
<xpath expr="//field[@name='property_account_expense_id']" position="after">
<field name="property_account_expense_employee_id" class="w-50" groups="account.group_account_readonly"/>
<field name="property_account_expense_company_id" class="w-50" groups="account.group_account_readonly"/>
<field name="receipt_due_days" class="w-25"/>
</xpath>
</field>
</record>
<!-- Also inherit the template form for standard product views -->
<record id="product_template_expense_form_view_inherit_split" model="ir.ui.view">
<field name="name">product.template.expense.form.split</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='payables']" position="inside">
<field name="property_account_expense_employee_id" invisible="not can_be_expensed"/>
<field name="property_account_expense_company_id" invisible="not can_be_expensed"/>
<field name="receipt_due_days" invisible="not can_be_expensed"/>
</xpath>
</field>
</record>
</odoo>