lunch_alert_views.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="lunch_alert_view_search" model="ir.ui.view">
  4. <field name="name">lunch.alert.search</field>
  5. <field name="model">lunch.alert</field>
  6. <field name="arch" type="xml">
  7. <search string="Search">
  8. <field name="message"/>
  9. <filter name="inactive_today" string="Currently inactive" domain="[('available_today', '=', False)]"/>
  10. <separator/>
  11. <filter name="active" string="Active" domain="[('active', '=', True)]"/>
  12. <filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
  13. </search>
  14. </field>
  15. </record>
  16. <record id="lunch_alert_view_tree" model="ir.ui.view">
  17. <field name="name">lunch.alert.tree</field>
  18. <field name="model">lunch.alert</field>
  19. <field name="arch" type="xml">
  20. <tree>
  21. <field name="name"/>
  22. <field name="mode"/>
  23. <field name="message" invisible="1"/>
  24. <field name="available_today"/>
  25. <field name="active" widget="boolean_toggle"/>
  26. </tree>
  27. </field>
  28. </record>
  29. <record id="lunch_alert_view_form" model="ir.ui.view">
  30. <field name="name">lunch.alert.form</field>
  31. <field name="model">lunch.alert</field>
  32. <field name="arch" type="xml">
  33. <form string="alert form">
  34. <sheet>
  35. <div class="oe_title" name="title">
  36. <label for="name"/>
  37. <h1>
  38. <field name="name" placeholder="e.g. Order before 11am"/>
  39. </h1>
  40. </div>
  41. <group>
  42. <group>
  43. <field name="mode" widget="radio"/>
  44. <field name="recipients" attrs="{'invisible': [['mode', '!=', 'chat']]}" widget="radio"/>
  45. <field name="location_ids" widget="many2many_tags" required="1"/>
  46. <field name="until"/>
  47. <field name="active" widget="boolean_toggle"/>
  48. </group>
  49. <group>
  50. <div class="o_td_label">
  51. <label for="notification_time" attrs="{'invisible': [['mode', '!=', 'chat']]}"/>
  52. </div>
  53. <div class="o_col">
  54. <widget name="week_days"/>
  55. <div class="o_row" attrs="{'invisible': [['mode', '!=', 'chat']]}">
  56. <field name="notification_time" attrs="{'required': [('mode', '=', 'chat')]}" widget="float_time"/>
  57. <field name="notification_moment"/>
  58. </div>
  59. </div>
  60. <field name="tz" groups="base.group_no_one"/>
  61. </group>
  62. <group>
  63. <field name="message"/>
  64. </group>
  65. </group>
  66. </sheet>
  67. </form>
  68. </field>
  69. </record>
  70. <record id="lunch_alert_view_kanban" model="ir.ui.view">
  71. <field name="name">lunch.alert.kanban</field>
  72. <field name="model">lunch.alert</field>
  73. <field name="arch" type="xml">
  74. <kanban class="o_kanban_mobile">
  75. <templates>
  76. <t t-name="kanban-box">
  77. <div class="oe_kanban_card oe_kanban_global_click">
  78. <div class="oe_kanban_content">
  79. <div class="o_kanban_record_top">
  80. <div class="o_kanban_record_headings">
  81. <strong class="o_kanban_record_title"><field name="name"/></strong>
  82. <span><br/><field name="mode"/></span>
  83. <span attrs="{'invisible':[['mode', '!=', 'chat']]}">
  84. to <field name="recipients"/>
  85. on <field name="notification_time"/>
  86. <field name="notification_moment"/>
  87. </span>
  88. </div>
  89. </div>
  90. <div class="o_kanban_record_body">
  91. <field name="location_ids" widget="many2many_tags"/>
  92. </div>
  93. </div>
  94. </div>
  95. </t>
  96. </templates>
  97. </kanban>
  98. </field>
  99. </record>
  100. <record id="lunch_alert_action" model="ir.actions.act_window">
  101. <field name="name">Lunch Alerts</field>
  102. <field name="res_model">lunch.alert</field>
  103. <field name="search_view_id" ref="lunch_alert_view_search"/>
  104. <field name="view_mode">tree,form,kanban</field>
  105. <field name="domain">['|', ('active', '=', True), ('active', '=', False)]</field>
  106. <field name="context">{}</field>
  107. <field name="view_id" ref="lunch_alert_view_tree"/>
  108. <field name="help" type="html">
  109. <p class="o_view_nocontent_smiling_face">
  110. Create new lunch alerts
  111. </p>
  112. </field>
  113. </record>
  114. </odoo>