Odoo modules related to point of sales
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
6.1 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="restaurant_booking_form" model="ir.ui.view">
  4. <field name="name">Booking restaurant.booking form</field>
  5. <field name="model">restaurant.booking</field>
  6. <field name="arch" type="xml">
  7. <form>
  8. <sheet>
  9. <div class="oe_title">
  10. <label for="name" class="oe_edit_only"/>
  11. <h1>
  12. <field name="name"/>
  13. </h1>
  14. </div>
  15. <group>
  16. <group>
  17. <field name="date" class="oe_inline"/>
  18. <label for="time_start" string="Times"/>
  19. <div class="o_row">
  20. <span>from</span>
  21. <field name="time_start" class="oe_inline" widget="float_time"/>
  22. <span>to</span>
  23. <field name="time_stop" class="oe_inline" widget="float_time"/>
  24. </div>
  25. <field name="duration" class="oe_inline" widget="float_time"/>
  26. <field name="datetime_start" invisible="1"/>
  27. <field name="datetime_stop" invisible="1"/>
  28. </group>
  29. <group>
  30. <field name="count" class="oe_inline"/>
  31. <field name="available_table_ids" invisible="1"/>
  32. <field name="table_ids" widget="many2many_tags" options="{'no_create':1}"
  33. attrs="{'invisible': ['|',('datetime_start','=',False),('datetime_stop','=',False)]}"/>
  34. <field name="table_capacity" invisible="1"/>
  35. <field name="table_capacity_ok" invisible="1"/>
  36. <div colspan="2" class="alert alert-warning" role="alert" attrs="{'invisible':[('table_capacity_ok','=',True)]}">
  37. <i icon="fa-exclamation-triangle"/>
  38. <span class="ml8">The total seats of selected tables is lower than the people count.</span>
  39. </div>
  40. </group>
  41. </group>
  42. </sheet>
  43. </form>
  44. </field>
  45. </record>
  46. <record id="restaurant_booking_tree" model="ir.ui.view">
  47. <field name="name">Booking restaurant.booking tree</field>
  48. <field name="model">restaurant.booking</field>
  49. <field name="arch" type="xml">
  50. <tree expand="true">
  51. <field name="name"/>
  52. <field name="date"/>
  53. <field name="time_start" widget="float_time"/>
  54. <field name="time_stop" widget="float_time"/>
  55. <field name="duration" widget="float_time"/>
  56. <field name="count"/>
  57. <field name="table_ids" widget="many2many_tags"/>
  58. <field name="available_table_ids" invisible="1"/>
  59. </tree>
  60. </field>
  61. </record>
  62. <record id="restaurant_booking_search" model="ir.ui.view">
  63. <field name="name">Booking restaurant.booking search</field>
  64. <field name="model">restaurant.booking</field>
  65. <field name="arch" type="xml">
  66. <search>
  67. <field name="name"/>
  68. <field name="date"/>
  69. <field name="table_ids"/>
  70. <group expand="0" string="Filters">
  71. <filter name="today" string="Today" domain="[('date','=',context_today().strftime('%Y-%m-%d'))]"/>
  72. <filter name="tomorrow" string="Tomorrow" domain="[('date','=',(context_today() + relativedelta(days=1)).strftime('%Y-%m-%d'))]"/>
  73. <filter name="next_we" string="Next wednesday" domain="[('date','=',(context_today() + relativedelta(weeks=context_today().weekday() &gt;= 3 and 1 or 0, weekday=2)).strftime('%Y-%m-%d'))]"/>
  74. <filter name="next_sa" string="Next saturday" domain="[('date','=',(context_today() + relativedelta(weeks=context_today().weekday() &gt;= 5 and 1 or 0, weekday=5)).strftime('%Y-%m-%d'))]"/>
  75. <filter name="next_su" string="Next sunday" domain="[('date','=',(context_today() + relativedelta(weeks=context_today().weekday() &gt;= 6 and 1 or 0, weekday=6)).strftime('%Y-%m-%d'))]"/>
  76. <separator/>
  77. <filter name="this_week" string="This week" domain="[('date','&gt;=',(context_today() + relativedelta(weekday=0)).strftime('%Y-%m-%d')),('date','&lt;=',(context_today() + relativedelta(weekday=6)).strftime('%Y-%m-%d'))]"/>
  78. <filter name="next_week" string="Next week" domain="[('date','&gt;=',(context_today() + relativedelta(weeks=1, weekday=0)).strftime('%Y-%m-%d')),('date','&lt;=',(context_today() + relativedelta(weeks=1, weekday=6)).strftime('%Y-%m-%d'))]"/>
  79. <separator/>
  80. <filter name="upcoming" string="Upcoming" domain="[('date','&gt;=',context_today().strftime('%Y-%m-%d'))]"/>
  81. </group>
  82. <group expand="0" string="Group By">
  83. <filter name="by_date" string="Date" domain="[]" context="{'group_by': 'date:day'}"/>
  84. </group>
  85. </search>
  86. </field>
  87. </record>
  88. <record id="restaurant_booking_act_window" model="ir.actions.act_window">
  89. <field name="name">All bookings</field>
  90. <field name="res_model">restaurant.booking</field>
  91. <field name="view_mode">tree,form</field>
  92. <field name="context">{'search_default_upcoming':1, 'search_default_this_week':1, 'search_default_by_date':1}</field>
  93. <field name="help" type="html">
  94. <p class="o_view_nocontent_smiling_face">
  95. Schedule a new booking.
  96. </p><p>
  97. To book, you must provide a name, a date, start and stop hours, the people count and one or more tables.
  98. </p>
  99. </field>
  100. </record>
  101. <record id="create_new_booking_act_window" model="ir.actions.act_window">
  102. <field name="name">New booking</field>
  103. <field name="type">ir.actions.act_window</field>
  104. <field name="res_model">restaurant.booking</field>
  105. <field name="view_id" ref="restaurant_booking_form"/>
  106. <field name="target">new</field>
  107. </record>
  108. <menuitem
  109. id="restaurant_booking_root_menu"
  110. name="Bookings"
  111. parent="point_of_sale.menu_point_root"
  112. sequence="5"
  113. groups="point_of_sale.group_pos_user"/>
  114. <menuitem
  115. id="restaurant_new_booking_menu"
  116. name="New booking"
  117. parent="restaurant_booking_root_menu"
  118. action="create_new_booking_act_window"
  119. sequence="10"
  120. groups="point_of_sale.group_pos_user"/>
  121. <menuitem
  122. id="restaurant_booking_menu"
  123. name="All bookings"
  124. parent="restaurant_booking_root_menu"
  125. action="restaurant_booking_act_window"
  126. sequence="30"
  127. groups="point_of_sale.group_pos_user"/>
  128. </odoo>