You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

44 lines
2.6 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Inherit form view of account.payment model-->
<record id="view_account_payment_form" model="ir.ui.view">
<field name="name">account.payment.view.form.inherit.account.payment.approval</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//header//button[@name='action_post']" position="after">
<button name="approve_transfer" string="Approve" type="object"
class="oe_highlight"
invisible="is_approve_person == False or state !='waiting_approval'"/>
<button name="reject_transfer" string="Reject" type="object"
class="oe_highlight" invisible="is_approve_person == False or state !='waiting_approval'"/>
</xpath>
<xpath expr="//header//button[@name='action_post']" position="attributes">
<attribute name="invisible"> state not in ['draft','approved']</attribute>
</xpath>
<xpath expr="//header//button[@name='action_cancel']" position="attributes">
<attribute name="invisible">state in ['cancelled', 'posted', 'rejected']
</attribute>
</xpath>
<field name="partner_id" position="after">
<field name="is_approve_person" invisible="1"/>
</field>
</field>
</record>
<!-- Inherit account.payment to add filters -->
<record id="view_account_payment_search" model="ir.ui.view">
<field name="name">account.payment.view.search.inherit.account.payment.approval</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_search"/>
<field name="arch" type="xml">
<xpath expr="//search/filter[@name='state_draft']" position="after">
<filter string="Waiting For Approval" name="state_waiting_approval"
domain="[('state', '=', 'waiting_approval')]"/>
<filter string="Approved" name="state_approved"
domain="[('state', '=', 'approved')]"/>
<filter string="Rejected" name="state_rejected"
domain="[('state', '=', 'rejected')]"/>
</xpath>
</field>
</record>
</odoo>