purchase_advance_payment/views/purchase_order_views.xml
2025-09-23 14:15:11 +07:00

56 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Purchase Order Form View -->
<record id="view_purchase_order_form_inherit_advance_payment" model="ir.ui.view">
<field name="name">purchase.order.form.inherit.advance.payment</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet/group/group[2]" position="after">
<group>
<field name="deposit_product_id" invisible="1"/>
</group>
</xpath>
<xpath expr="//sheet/notebook" position="inside">
<page string="Advance Payments" name="advance_payments">
<group>
<field name="advance_payment_total" widget="monetary"/>
<field name="amount_residual" widget="monetary"/>
</group>
<group>
<button name="action_apply_deposit"
string="Apply Deposit"
type="object"
class="btn-primary"
invisible="advance_payment_total &lt;= 0"/>
<button name="%(purchase_advance_payment.action_link_advance_payment_wizard)d"
string="Link Advance Payment"
type="action"
class="btn-secondary"
context="{'default_purchase_order_id': active_id}"/>
</group>
<field name="advance_payment_ids">
<tree>
<field name="name"/>
<field name="date"/>
<field name="amount" widget="monetary"/>
<field name="state"/>
<field name="journal_id"/>
</tree>
</field>
</page>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="after">
<field name="is_deposit" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']/form//field[@name='price_unit']" position="after">
<field name="is_deposit" invisible="1"/>
</xpath>
</field>
</record>
</data>
</odoo>