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.

205 lines
10 KiB

  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data>
  4. <!-- Configurator -->
  5. <record model="ir.ui.view" id="super_calendar_configurator_tree">
  6. <field name="name">super_calendar_configurator_tree</field>
  7. <field name="model">super.calendar.configurator</field>
  8. <field name="arch" type="xml">
  9. <tree string="Configurators">
  10. <field name="name"/>
  11. </tree>
  12. </field>
  13. </record>
  14. <record model="ir.ui.view" id="super_calendar_configurator_form">
  15. <field name="name">super_calendar_configurator_form</field>
  16. <field name="model">super.calendar.configurator</field>
  17. <field name="arch" type="xml">
  18. <form string="Configurator">
  19. <field name="name" select="1" colspan="2"/>
  20. <newline/>
  21. <field name="line_ids" nolabel="1" colspan="4">
  22. <tree string="Lines">
  23. <field name="name"/>
  24. <field name="domain"/>
  25. </tree>
  26. <form string="Line">
  27. <group>
  28. <group>
  29. <field name="name"/>
  30. <field name="domain"/>
  31. <field name="user_field_id"/>
  32. </group>
  33. <group>
  34. <field name="date_start_field_id"/>
  35. <field name="duration_field_id"/>
  36. <field name="date_stop_field_id"
  37. attrs="{'readonly':[('duration_field_id','!=',False)], 'visible': [('duration_field_id','!=',False)]}"/>
  38. </group>
  39. </group>
  40. <group string="Description">
  41. <field name="description_type"/>
  42. <newline/>
  43. <field name="description_field_id"
  44. attrs="{'required':[('description_type','!=','code')], 'invisible':[('description_type','==','code')]}"/>
  45. <group colspan="4" col="1" attrs="{'invisible':[('description_type','!=','code')]}">
  46. <label string="Use '${o}' to refer to the involved object. E.g.: '${o.project_id.name}'" />
  47. <field name="description_code" nolabel="1"
  48. attrs="{'required':[('description_type','==','code')]}"/>
  49. </group>
  50. </group>
  51. </form>
  52. </field>
  53. <newline/>
  54. <button name="generate_calendar_records"
  55. string="Generate Calendar" type="object" icon="gtk-go-forward" colspan="2"/>
  56. </form>
  57. </field>
  58. </record>
  59. <record model="ir.actions.act_window" id="super_calendar_configurator">
  60. <field name="name">Calendar Configurators</field>
  61. <field name="res_model">super.calendar.configurator</field>
  62. <field name="view_type">form</field>
  63. <field name="view_mode">tree,form</field>
  64. <field name="view_id" ref="super_calendar_configurator_tree"/>
  65. </record>
  66. <!-- Calendar -->
  67. <record model="ir.ui.view" id="super_calendar_tree">
  68. <field name="name">super_calendar_tree</field>
  69. <field name="model">super.calendar</field>
  70. <field name="arch" type="xml">
  71. <tree string="Calendar">
  72. <field name="name"/>
  73. <field name="date_start"/>
  74. <field name="duration"/>
  75. <field name="user_id"/>
  76. <field name="configurator_id"/>
  77. <field name="model_id"/>
  78. </tree>
  79. </field>
  80. </record>
  81. <record model="ir.ui.view" id="super_calendar_form">
  82. <field name="name">super_calendar_form</field>
  83. <field name="model">super.calendar</field>
  84. <field name="arch" type="xml">
  85. <form string="Calendar">
  86. <sheet>
  87. <group>
  88. <field name="name"/>
  89. <field name="date_start"/>
  90. <field name="duration"/>
  91. <field name="user_id"/>
  92. <field name="configurator_id"/>
  93. <field name="model_id"/>
  94. <field name="res_id"/>
  95. </group>
  96. </sheet>
  97. </form>
  98. </field>
  99. </record>
  100. <record model="ir.ui.view" id="super_calendar">
  101. <field name="name">super_calendar</field>
  102. <field name="model">super.calendar</field>
  103. <field name="arch" type="xml">
  104. <calendar string="Calendar" color="model_id"
  105. date_start="date_start" date_delay="duration"
  106. quick_add="false">
  107. <field name="name"/>
  108. </calendar>
  109. </field>
  110. </record>
  111. <record model="ir.ui.view" id="super_calendar_search">
  112. <field name="name">super_calendar_search</field>
  113. <field name="model">super.calendar</field>
  114. <field name="arch" type="xml">
  115. <search string="Search Calendar" >
  116. <field name="name"/>
  117. <field name="configurator_id" select="1"/>
  118. <field name="model_id" select="1"/>
  119. <field name="user_id" widget="selection" >
  120. <filter domain="[('user_id','=',uid)]" help="My Items" icon="terp-personal"/>
  121. </field>
  122. <newline/>
  123. <group expand="0" string="Extended Filters..." colspan="4" col="8">
  124. <field name="date_start" />
  125. <field name="duration" />
  126. </group>
  127. <group expand="0" string="Period">
  128. <filter string="Current week"
  129. name="current_week"
  130. domain="[('date_start','&lt;=', (context_today() + relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')),
  131. ('date_start','&gt;',(context_today() - relativedelta(weeks=1, weekday=6)).strftime('%%Y-%%m-%%d'))]"
  132. help="Display all elements in the current week." />
  133. <filter string="Current month"
  134. name="current_month"
  135. domain="[('date_start','&lt;',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')),
  136. ('date_start','&gt;=',time.strftime('%%Y-%%m-01'))]"
  137. help="Display all elements in the current month." />
  138. <filter string="Next week"
  139. name="next_week"
  140. domain="[('date_start','&gt;',(context_today()+relativedelta(weeks=0, weekday=6)).strftime('%%Y-%%m-%%d')),
  141. ('date_start','&lt;=',(context_today()+relativedelta(weeks=1, weekday=6)).strftime('%%Y-%%m-%%d'))]"
  142. help="Display all elements in the next week." />
  143. <filter string="Next month"
  144. name="next_month"
  145. domain="[('date_start','&gt;=',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01')),
  146. ('date_start','&lt;',(context_today()+relativedelta(months=2)).strftime('%%Y-%%m-01'))]"
  147. help="Display all elements in the next month." />
  148. </group>
  149. <group expand="1" string="Group By">
  150. <filter string="Day"
  151. name="group_day"
  152. context="{'group_by':'date_start:day'}"
  153. help="Group all elements in the same day."/>
  154. <filter string="Week"
  155. name="group_week"
  156. context="{'group_by':'date_start:week'}"
  157. help="Group all elements in the same week."/>
  158. <filter string="Month"
  159. name="group_month"
  160. context="{'group_by':'date_start:month'}"
  161. help="Group all elements in the same month."/>
  162. <filter string="Quarter"
  163. name="group_quarter"
  164. context="{'group_by':'date_start:quarter'}"
  165. help="Group all elements in the same quarter."/>
  166. <filter string="Year"
  167. name="group_year"
  168. context="{'group_by':'date_start:year'}"
  169. help="Group all elements in the same year."/>
  170. </group>
  171. </search>
  172. </field>
  173. </record>
  174. <record model="ir.actions.act_window" id="super_calendar_action">
  175. <field name="name">Super Calendar</field>
  176. <field name="res_model">super.calendar</field>
  177. <field name="view_type">form</field>
  178. <field name="view_mode">calendar,tree,form</field>
  179. <field name="view_id" ref="super_calendar"/>
  180. </record>
  181. <menuitem id="super_calendar_menu" name="Super Calendar"
  182. action="super_calendar_action"/>
  183. <menuitem id="super_calendar_calendar" name="Calendar"
  184. parent="super_calendar_menu" />
  185. <menuitem id="super_calendar_calendar_calendar" name="Calendar"
  186. parent="super_calendar_calendar" action="super_calendar_action"/>
  187. <menuitem id="super_calendar_configuration" name="Configuration"
  188. parent="super_calendar_menu" />
  189. <menuitem id="super_calendar_configurators" name="Configurators"
  190. parent="super_calendar_configuration" action="super_calendar_configurator"/>
  191. </data>
  192. </openerp>