28 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
		
			Executable File
		
	
			
		
		
	
	
			28 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
		
			Executable File
		
	
| <?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.rounding</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="global_discount" attrs="{'invisible': [('state','!=', 'draft'),('state','!=', 'sent')]}"/>
 | |
|                   <div name='global_discount'>
 | |
|                       <div>
 | |
|                         <field name='global_discount' class="oe_inline" nolabel="1" attrs="{'invisible': [('state','!=', 'draft'),('state','!=', 'sent')]}"/>
 | |
|                         <field name='discount_type' class="oe_inline" nolabel="1" attrs="{'invisible': ['|',('global_discount','=', False),'&', ('state','!=', 'draft'),('state','!=', 'sent')], 'required':[('global_discount','!=', False)]}"/>
 | |
|                         <field name='discount_amount' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False),('discount_type','!=','fixed'),'&', ('state','!=', 'draft'),('state','!=', 'sent')]}"/>
 | |
|                         <field name='discount_percentage' class="oe_inline" nolabel="1" attrs="{'invisible': ['|','|',('global_discount','=', False),('discount_type','!=','percentage'),'&', ('state','!=', 'draft'),('state','!=', 'sent')]}"/>
 | |
|                         <button name="create_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']),('global_discount','=', False)]}"/>
 | |
|                       </div>
 | |
|                   </div>
 | |
|                 </xpath>
 | |
|             </data>
 | |
|         </field>
 | |
|     </record>
 | |
| 
 | |
| </odoo>
 |