Files
public/ruodoo_commission/views/sale_order_views.xml

49 lines
2.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_form_commission" model="ir.ui.view">
<field name="name">sale.order.form.commission</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<!-- Кнопка «Начислить комиссию»: только подтверждённый заказ,
только группа «Начисляет комиссии» -->
<xpath expr="//header" position="inside">
<button name="action_accrue_commission" type="object"
string="Начислить комиссию" class="btn-primary"
invisible="state != 'sale'"
groups="ruodoo_commission.group_commission_manager"/>
</xpath>
<!-- Смарт-кнопка «Комиссии» -->
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_view_commission_bills" type="object"
class="oe_stat_button" icon="fa-money"
groups="ruodoo_commission.group_commission_viewer">
<field name="commission_bill_count" widget="statinfo"
string="Комиссии"/>
</button>
</xpath>
<!-- Колонка «Комиссии» в строках заказа (рядом с налогами) -->
<xpath expr="//field[@name='order_line']/list/field[@name='tax_ids']"
position="after">
<field name="commission_ids" widget="many2many_tags"
optional="show"
groups="ruodoo_commission.group_commission_viewer"/>
<field name="commission_amount"
groups="ruodoo_commission.group_commission_viewer"/>
</xpath>
<!-- Строка «ИТОГО КОМИССИЙ» рядом с итогами/налогами -->
<xpath expr="//field[@name='tax_totals']" position="after">
<field name="amount_commission"
groups="ruodoo_commission.group_commission_viewer"/>
</xpath>
</field>
</record>
</odoo>