Files
enterprise-addons/hr_payroll_expense/views/hr_expense_views.xml
T

66 lines
4.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_expense_view_form_inherit_payroll" model="ir.ui.view">
<field name="name">hr.expense.view.form.payroll</field>
<field name="model">hr.expense</field>
<field name="inherit_id" ref="hr_expense.hr_expense_view_form"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<field name="payslip_id" invisible="1"/>
<field name="refund_in_payslip" invisible="1"/>
<button class="oe_stat_button" name="action_open_payslip" type="object" icon="fa-dollar" invisible="not payslip_id">
<div class="o_stat_info">
<span class="o_stat_text">Payslip</span>
</div>
</button>
</div>
<xpath expr="//button[hasclass('o_expense_post_highlight')]" position="after">
<button name="action_report_in_next_payslip" string="Report in Next Payslip" type="object"
groups="account.group_account_invoice,hr_payroll.group_hr_payroll_user"
invisible="nb_attachment == 0 or refund_in_payslip or state != 'approved' or payment_mode == 'company_account'"
data-hotkey="g"/>
<button name="action_remove_from_payslip" string="Remove from Payslip" type="object"
groups="account.group_account_invoice,hr_payroll.group_hr_payroll_user"
invisible="nb_attachment == 0 or not refund_in_payslip or state in ('posted', 'in_payment', 'paid') or payment_mode == 'company_account'"
class="oe_highlight" data-hotkey="g"/>
</xpath>
<xpath expr="//button[hasclass('o_expense_post')]" position="after">
<button name="action_report_in_next_payslip" string="Report in Next Payslip" type="object"
groups="account.group_account_invoice,hr_payroll.group_hr_payroll_user" data-hotkey="g"
invisible="nb_attachment &gt;= 1 or refund_in_payslip or state != 'approved' or payment_mode == 'company_account'"/>
<button name="action_remove_from_payslip" string="Remove from Payslip" type="object"
groups="account.group_account_invoice,hr_payroll.group_hr_payroll_user" data-hotkey="g"
invisible="nb_attachment &gt;= 1 or not refund_in_payslip or state in ('posted', 'in_payment', 'paid') or payment_mode == 'company_account'"/>
</xpath>
<xpath expr="//button[hasclass('o_expense_post_highlight')]" position="attributes">
<attribute name="invisible">nb_attachment == 0 or state != 'approved' or refund_in_payslip</attribute>
</xpath>
<xpath expr="//button[hasclass('o_expense_post')]" position="attributes">
<attribute name="invisible">nb_attachment &gt;= 1 or state != 'approved' or refund_in_payslip</attribute>
</xpath>
<xpath expr="//button[hasclass('o_expense_refuse')]" position="attributes">
<attribute name="invisible">state not in ('submitted', 'approved') or refund_in_payslip</attribute>
</xpath>
<xpath expr="//button[hasclass('o_expense_split_user')]" position="attributes">
<attribute name="invisible">state != 'draft' or product_has_cost or refund_in_payslip</attribute>
</xpath>
<xpath expr="//button[hasclass('o_expense_split_manager')]" position="attributes">
<attribute name="invisible">state in ('in_payment', 'paid', 'refused', 'posted') or product_has_cost or refund_in_payslip</attribute>
</xpath>
</field>
</record>
<record id="hr_expense_add_to_payslip_action_server" model="ir.actions.server">
<field name="name">Report in Next Payslip</field>
<field name="model_id" ref="model_hr_expense"/>
<field name="binding_model_id" ref="model_hr_expense"/>
<field name="binding_type">action</field>
<field name="binding_view_types">list,kanban</field>
<field name="group_ids" eval="[(4, ref('account.group_account_manager'))]"/>
<field name="state">code</field>
<field name="code">
records.action_report_in_next_payslip()
</field>
</record>
</odoo>