odoo/ext/custom-addons/tz_dealer_discount/views/invoice_view.xml

60 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Invoice View -->
<record id="invoice_form" model="ir.ui.view">
<field name="name">account.invoice.form.dealer_discount</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='user_id']" position="after">
<label for="dealer_discount"/>
<div name='dealer_discount'>
<div>
<field name='dealer_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft')]}"/>
<field name='dealer_discount_product' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('dealer_discount','=', False),'&amp;', ('state','!=', 'draft')]}"/>
<field name='dealer_discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('dealer_discount','=', False), ('state','!=', 'draft')], 'required':[('dealer_discount','!=', False)]}"/>
<field name='dealer_discount_amount' style="min-width:80px;max-width:80px;width:80px;" class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('dealer_discount','=', False), ('state','!=', 'draft'),('dealer_discount_type','!=','fixed')]}"/>
<field name='dealer_discount_percentage' style="min-width:50px;max-width:50px;width:50px;" class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('dealer_discount','=', False), ('state','!=', 'draft'),('dealer_discount_type','!=','percentage')]}"/>
<button name="create_dealer_discount" string="Add Line" type="object" class="oe_inline fa fa-arrow-right oe_link oe_edit_only"
attrs="{'invisible': ['|',('state','not in', ['draft','sent']),('dealer_discount','=', False)]}"
style="margin-right:0px;"/>
</div>
<div>
<button name="unset_dealer_discount" string="Remove Lines" type="object" class="oe_inline fa fa-arrow-left oe_link oe_edit_only" attrs="{'invisible': ['|',('state','not in', ['draft','sent']),('dealer_discount','=', False)]}"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
<!-- Bill View -->
<record id="invoice_supplier_form" model="ir.ui.view">
<field name="name">account.invoice.form.dealer_discount</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='date_due']" position="after">
<label for="dealer_discount"/>
<div name='dealer_discount'>
<div>
<field name='dealer_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft')]}"/>
<field name='dealer_discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('dealer_discount','=', False), ('state','!=', 'draft')], 'required':[('dealer_discount','!=', False)]}"/>
<field name='dealer_discount_amount' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('dealer_discount','=', False), ('state','!=', 'draft'),('dealer_discount_type','!=','fixed')]}"/>
<field name='dealer_discount_percentage' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('dealer_discount','=', False), ('state','!=', 'draft'),('dealer_discount_type','!=','percentage')]}"/>
</div>
<div>
<button name="create_dealer_discount" string="Add Line" type="object" class="oe_inline fa fa-arrow-right oe_link" attrs="{'invisible': ['|',('dealer_discount','=', False), ('state','!=', 'draft')]}"/>
<button name="unset_dealer_discount" string="Remove Lines" type="object" class="oe_inline fa fa-arrow-left oe_link" attrs="{'invisible': ['|',('dealer_discount','=', False), ('state','!=', 'draft')]}"/>
</div>
</div>
</xpath>
</data>
</field>
</record>
</odoo>