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

34 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Sale View -->
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form.dealer_discount</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='payment_term_id']" position="after">
<label for="dealer_discount" attrs="{'invisible': [('state','!=', 'draft'),('state','!=', 'sent')]}"/>
<div name='dealer_discount'>
<div>
<field name='dealer_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft'),('state','!=', 'sent')]}"/>
<field name='dealer_discount_product' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('dealer_discount','=', False),'&amp;', ('state','!=', 'draft'),('state','!=', 'sent')]}"/>
<field name='dealer_discount_type' class="oe_inline oe_edit_only" nolabel="1" attrs="{'invisible': ['|',('dealer_discount','=', False),'&amp;', ('state','!=', 'draft'),('state','!=', 'sent')], 'required':[('dealer_discount','!=', False)]}"/>
<field name='dealer_discount_amount' style="min-width:80px;max-width:80px;width:80px;" class="oe_inline oe_edit_only" nolabel="1" attrs="{'invisible': ['|','|',('dealer_discount','=', False),('dealer_discount_type','!=','fixed'),'&amp;', ('state','!=', 'draft'),('state','!=', 'sent')]}"/>
<field name='dealer_discount_percentage' style="min-width:50px;max-width:50px;width:50px;" class="oe_inline oe_edit_only" nolabel="1" attrs="{'invisible': ['|','|',('dealer_discount','=', False),('dealer_discount_type','!=','percentage'),'&amp;', ('state','!=', 'draft'),('state','!=', 'sent')]}"/>
<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>
</odoo>