flectra/addons/event_sale/views/sale_order_views.xml
2018-01-16 02:34:37 -08:00

24 lines
1.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="view_sale_order_form_inherit_event" model="ir.ui.view">
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']//form//field[@name='product_id']" position="after">
<field name="event_id" domain="[('event_ticket_ids.product_id','=', product_id),('date_end','&gt;=',time.strftime('%Y-%m-%d 00:00:00'))]" attrs="{'invisible': [('event_ok', '=', False)],'required': [('event_ok', '!=', False)]}"/>
<field name="event_ticket_id" domain="[('event_id', '=', event_id), ('product_id','=',product_id), '|', ('seats_availability', '=', 'unlimited'), ('seats_available', '>', 0)]" attrs="{'invisible': [('event_ok', '=', False)], 'required': [('event_ok', '!=', False)]}"/>
<field name="event_ok" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']//tree//field[@name='product_id']" position="after">
<field name="event_ok" invisible="1"/>
</xpath>
</field>
</record>
<!-- the presence of 'event user' makes the order lines non-editable -->
<record id="sale.view_order_form_editable_list" model="ir.ui.view">
<field name="groups_id" eval="[(4, ref('event.group_event_user'))]"/>
</record>
</flectra>