| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<record id="event_configurator_view_form" model="ir.ui.view"> |
| 4 |
<field name="name">event.configurator.view.form</field> |
| 5 |
<field name="model">event.event.configurator</field> |
| 6 |
<field name="arch" type="xml"> |
| 7 |
<form js_class="event_configurator_form"> |
| 8 |
<field name="has_available_tickets" invisible="1"/> |
| 9 |
<div invisible="has_available_tickets"> |
| 10 |
We could not find a matching event ticket for this product. <br/> |
| 11 |
<a role="button" class="btn btn-link" target="_blank" |
| 12 |
href="/odoo/action-event.action_event_view"> |
| 13 |
<i class="fa fa-arrow-right"/> Configure Events & Tickets |
| 14 |
</a> |
| 15 |
</div> |
| 16 |
<group invisible="not has_available_tickets"> |
| 17 |
<field |
| 18 |
name="event_id" |
| 19 |
domain="[ |
| 20 |
('event_ticket_ids.product_id','=', product_id), |
| 21 |
('date_end','>=',time.strftime('%Y-%m-%d 00:00:00')) |
| 22 |
]" |
| 23 |
required="1" |
| 24 |
context="{'name_with_seats_availability': True}" |
| 25 |
options="{'no_open': True, 'no_create': True}" |
| 26 |
placeholder="All Events" |
| 27 |
/> |
| 28 |
<field name="event_slot_id" |
| 29 |
domain="[('event_id', '=', event_id)]" |
| 30 |
invisible="not is_multi_slots" |
| 31 |
required="is_multi_slots" |
| 32 |
context="{'name_with_seats_availability': True}" |
| 33 |
options="{'no_open': True, 'no_create': True}"/> |
| 34 |
<field |
| 35 |
name="event_ticket_id" |
| 36 |
domain="[('event_id', '=', event_id), ('product_id', '=', product_id)]" |
| 37 |
invisible="not event_id" |
| 38 |
required="event_id" |
| 39 |
context="{'name_with_seats_availability': True}" |
| 40 |
options="{'no_open': True, 'no_create': True}"/> |
| 41 |
<field name="product_id" invisible="1"/> |
| 42 |
</group> |
| 43 |
<footer> |
| 44 |
<button string="Add" invisible="not has_available_tickets" |
| 45 |
class="btn-primary o_event_sale_js_event_configurator_ok" special="save" data-hotkey="q"/> |
| 46 |
<button string="Discard" invisible="not has_available_tickets" |
| 47 |
class="btn-secondary" special="cancel" data-hotkey="x"/> |
| 48 |
<button string="Close" invisible="has_available_tickets" |
| 49 |
class="btn-secondary" special="cancel" data-hotkey="x"/> |
| 50 |
</footer> |
| 51 |
</form> |
| 52 |
</field> |
| 53 |
</record> |
| 54 |
|
| 55 |
<record id="event_configurator_action" model="ir.actions.act_window"> |
| 56 |
<field name="name">Select an Event</field> |
| 57 |
<field name="res_model">event.event.configurator</field> |
| 58 |
<field name="view_mode">form</field> |
| 59 |
<field name="target">new</field> |
| 60 |
<field name="context">{'name_with_seats_availability': True}</field> |
| 61 |
<field name="view_id" ref="event_configurator_view_form"/> |
| 62 |
</record> |
| 63 |
</odoo> |