resource_views.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- RESOURCE.RESOURCE -->
  4. <record id="view_resource_resource_search" model="ir.ui.view">
  5. <field name="name">resource.resource.search</field>
  6. <field name="model">resource.resource</field>
  7. <field name="arch" type="xml">
  8. <search string="Search Resource">
  9. <field name="name" />
  10. <field name="resource_type"/>
  11. <field name="user_id"/>
  12. <field name="calendar_id"/>
  13. <field name="company_id" groups="base.group_multi_company"/>
  14. <filter string="Human" name="human" domain="[('resource_type','=', 'user')]"/>
  15. <filter string="Material" name="material" domain="[('resource_type','=', 'material')]"/>
  16. <separator />
  17. <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
  18. <group expand="0" string="Group By">
  19. <filter string="User" name="user" domain="[]" context="{'group_by':'user_id'}"/>
  20. <filter string="Type" name="type" domain="[]" context="{'group_by':'resource_type'}"/>
  21. <filter string="Company" name="company" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
  22. <filter string="Working Time" name="working_period" domain="[]" context="{'group_by':'calendar_id'}"/>
  23. </group>
  24. </search>
  25. </field>
  26. </record>
  27. <record id="resource_resource_form" model="ir.ui.view">
  28. <field name="name">resource.resource.form</field>
  29. <field name="model">resource.resource</field>
  30. <field name="arch" type="xml">
  31. <form string="Resource">
  32. <sheet>
  33. <field name="active" invisible="1" />
  34. <field name="company_id" invisible="1"/>
  35. <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
  36. <group>
  37. <group name="user_details">
  38. <field name="name"/>
  39. <field name="user_id" attrs="{'required':[('resource_type','=','user')], 'invisible': [('resource_type','=','material')]}"/>
  40. <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
  41. <field name="resource_type" />
  42. </group>
  43. <group name="resource_details">
  44. <field name="calendar_id"/>
  45. <field name="tz"/>
  46. <field name="time_efficiency"/>
  47. </group>
  48. </group>
  49. </sheet>
  50. </form>
  51. </field>
  52. </record>
  53. <record id="resource_resource_tree" model="ir.ui.view">
  54. <field name="name">resource.resource.tree</field>
  55. <field name="model">resource.resource</field>
  56. <field name="arch" type="xml">
  57. <tree string="Resources" multi_edit="1" default_order="name">
  58. <field name="company_id" invisible="1"/>
  59. <field name="name" />
  60. <field name="user_id" />
  61. <field name="company_id" groups="base.group_multi_company" optional="show"/>
  62. <field name="calendar_id" optional="show" />
  63. <field name="tz" optional="hide" />
  64. <field name="resource_type" optional="show" />
  65. <field name="time_efficiency"/>
  66. </tree>
  67. </field>
  68. </record>
  69. <record id="action_resource_resource_tree" model="ir.actions.act_window">
  70. <field name="name">Resources</field>
  71. <field name="res_model">resource.resource</field>
  72. <field name="view_mode">tree,form</field>
  73. <field name="context">{}</field>
  74. <field name="search_view_id" ref="view_resource_resource_search"/>
  75. <field name="help">Resources allow you to create and manage resources that should be involved in a specific project phase. You can also set their efficiency level and workload based on their weekly working hours.</field>
  76. </record>
  77. <record id="resource_resource_action_from_calendar" model="ir.actions.act_window">
  78. <field name="name">Resources</field>
  79. <field name="res_model">resource.resource</field>
  80. <field name="view_mode">tree,form</field>
  81. <field name="context">{
  82. 'default_calendar_id': active_id,
  83. 'search_default_calendar_id': active_id}</field>
  84. <field name="search_view_id" ref="view_resource_resource_search"/>
  85. <field name="help">Resources allow you to create and manage resources that should be involved in a specific project phase. You can also set their efficiency level and workload based on their weekly working hours.</field>
  86. </record>
  87. <!-- RESOURCE.CALENDAR.LEAVES -->
  88. <record id="view_resource_calendar_leaves_search" model="ir.ui.view">
  89. <field name="name">resource.calendar.leaves.search</field>
  90. <field name="model">resource.calendar.leaves</field>
  91. <field name="arch" type="xml">
  92. <search string="Search Working Period Time Off">
  93. <field name="name"/>
  94. <field name="resource_id"/>
  95. <field name="company_id" groups="base.group_multi_company"/>
  96. <field name="calendar_id"/>
  97. <filter name="filter_date" date="date_from" default_period="this_year" string="Period"/>
  98. <group expand="0" string="Group By">
  99. <filter string="Resource" name="resource" domain="[]" context="{'group_by':'resource_id'}"/>
  100. <filter string="Company" name="company" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
  101. <filter string="Leave Date" name="leave_month" domain="[]" context="{'group_by':'date_from'}" help="Starting Date of Leave"/>
  102. </group>
  103. </search>
  104. </field>
  105. </record>
  106. <record id="view_resource_calendar" model="ir.ui.view">
  107. <field name="name">resource.calendar.leaves.calendar</field>
  108. <field name="model">resource.calendar.leaves</field>
  109. <field name="arch" type="xml">
  110. <calendar date_start="date_from" date_stop="date_to" mode="month" string="Resource" color="resource_id" event_limit="5">
  111. <field name="resource_id" avatar_field="image_128" filters="1"/>
  112. <field name="company_id"/>
  113. <field name="name"/>
  114. </calendar>
  115. </field>
  116. </record>
  117. <record id="resource_calendar_leave_form" model="ir.ui.view">
  118. <field name="name">resource.calendar.leaves.form</field>
  119. <field name="model">resource.calendar.leaves</field>
  120. <field name="arch" type="xml">
  121. <form string="Leave Detail">
  122. <field name="company_id" invisible="1"/>
  123. <sheet>
  124. <group>
  125. <group name="leave_details">
  126. <field name="name" string="Reason"/>
  127. <field name="calendar_id"/>
  128. <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company" attrs="{'invisible':[('calendar_id','=',False)]}"/>
  129. <field name="resource_id"/>
  130. </group>
  131. <group name="leave_dates">
  132. <field name="date_from"/>
  133. <field name="date_to"/>
  134. </group>
  135. </group>
  136. </sheet>
  137. </form>
  138. </field>
  139. </record>
  140. <record id="resource_calendar_leave_tree" model="ir.ui.view">
  141. <field name="name">resource.calendar.leaves.tree</field>
  142. <field name="model">resource.calendar.leaves</field>
  143. <field name="priority">1</field>
  144. <field name="arch" type="xml">
  145. <tree string="Leave Detail">
  146. <field name="name" string="Reason"/>
  147. <field name="resource_id" />
  148. <field name="company_id" groups="base.group_multi_company"/>
  149. <field name="calendar_id"/>
  150. <field name="date_from" />
  151. <field name="date_to" />
  152. </tree>
  153. </field>
  154. </record>
  155. <record id="action_resource_calendar_leave_tree" model="ir.actions.act_window">
  156. <field name="name">Resource Time Off</field>
  157. <field name="res_model">resource.calendar.leaves</field>
  158. <field name="view_mode">tree,form,calendar</field>
  159. <field name="search_view_id" ref="view_resource_calendar_leaves_search"/>
  160. </record>
  161. <record id="resource_calendar_leaves_action_from_calendar" model="ir.actions.act_window">
  162. <field name="name">Resource Time Off</field>
  163. <field name="res_model">resource.calendar.leaves</field>
  164. <field name="view_mode">tree,form,calendar</field>
  165. <field name="context">{
  166. 'default_calendar_id': active_id,
  167. 'search_default_calendar_id': active_id}</field>
  168. <field name="search_view_id" ref="view_resource_calendar_leaves_search"/>
  169. </record>
  170. <record id="resource_calendar_closing_days" model="ir.actions.act_window">
  171. <field name="name">Closing Days</field>
  172. <field name="res_model">resource.calendar.leaves</field>
  173. <field name="view_mode">calendar,tree,form</field>
  174. <field name="domain">[('calendar_id','=',active_id), ('resource_id','=',False)]</field>
  175. <field name="context">{'default_calendar_id': active_id}</field>
  176. <field name="binding_model_id" ref="model_resource_calendar"/>
  177. <field name="binding_view_types">form</field>
  178. </record>
  179. <record id="resource_calendar_resources_leaves" model="ir.actions.act_window">
  180. <field name="name">Resources Time Off</field>
  181. <field name="res_model">resource.calendar.leaves</field>
  182. <field name="view_mode">calendar,tree,form</field>
  183. <field name="domain">[('calendar_id','=',active_id), ('resource_id','!=',False)]</field>
  184. <field name="context">{'default_calendar_id': active_id}</field>
  185. <field name="binding_model_id" ref="model_resource_calendar"/>
  186. <field name="binding_view_types">form</field>
  187. </record>
  188. <!-- RESOURCE.CALENDAR.ATTENDANCE -->
  189. <record id="view_resource_calendar_attendance_tree" model="ir.ui.view">
  190. <field name="name">resource.calendar.attendance.tree</field>
  191. <field name="model">resource.calendar.attendance</field>
  192. <field name="arch" type="xml">
  193. <tree string="Working Time" editable="top">
  194. <field name="sequence" widget="handle"/>
  195. <field name="display_type" invisible="1"/>
  196. <field name="display_name" width="1" string=" " attrs="{'invisible': [('display_type', '!=', 'line_section')]}"/>
  197. <field name="name" attrs="{'invisible': [('display_type', '=', 'line_section')]}"/>
  198. <field name="dayofweek"/>
  199. <field name="day_period"/>
  200. <field name="hour_from" widget="float_time"/>
  201. <field name="hour_to" widget="float_time"/>
  202. <field name="date_from" optional="hide"/>
  203. <field name="date_to" optional="hide"/>
  204. <field name="week_type" readonly="1" force_save="1" groups="base.group_no_one"/>
  205. </tree>
  206. </field>
  207. </record>
  208. <record id="view_resource_calendar_attendance_form" model="ir.ui.view">
  209. <field name="name">resource.calendar.attendance.form</field>
  210. <field name="model">resource.calendar.attendance</field>
  211. <field name="arch" type="xml">
  212. <form string="Working Time">
  213. <sheet>
  214. <group>
  215. <field name="name"/>
  216. <field name="date_from"/>
  217. <field name="date_to"/>
  218. <field name="dayofweek"/>
  219. <label for="hour_from" string="Hours"/>
  220. <div class="o_row">
  221. <field name="hour_from" widget="float_time"/> -
  222. <field name="hour_to" widget="float_time"/>
  223. </div>
  224. <field name="day_period"/>
  225. </group>
  226. </sheet>
  227. </form>
  228. </field>
  229. </record>
  230. <!-- RESOURCE.CALENDAR -->
  231. <record id="view_resource_calendar_search" model="ir.ui.view">
  232. <field name="name">resource.calendar.search</field>
  233. <field name="model">resource.calendar</field>
  234. <field name="arch" type="xml">
  235. <search string="Search Working Time">
  236. <field name="name" string="Working Time"/>
  237. <field name="company_id" groups="base.group_multi_company"/>
  238. <separator/>
  239. <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
  240. </search>
  241. </field>
  242. </record>
  243. <record id="resource_calendar_form" model="ir.ui.view">
  244. <field name="name">resource.calendar.form</field>
  245. <field name="model">resource.calendar</field>
  246. <field name="arch" type="xml">
  247. <form string="Working Time">
  248. <field name="two_weeks_calendar" invisible="1"/>
  249. <header>
  250. <button name="switch_calendar_type" attrs="{'invisible':[('two_weeks_calendar', '=', True)]}" string="Switch to 2 weeks calendar" type="object" confirm="Are you sure you want to switch this calendar to 2 weeks calendar ? All entries will be lost"/>
  251. <button name="switch_calendar_type" attrs="{'invisible':[('two_weeks_calendar', '=', False)]}" string="Switch to 1 week calendar" type="object" confirm="Are you sure you want to switch this calendar to 1 week calendar ? All entries will be lost"/>
  252. </header>
  253. <sheet string="Working Time">
  254. <widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
  255. <div class="oe_button_box" name="button_box">
  256. <button name="%(resource_calendar_leaves_action_from_calendar)d" type="action"
  257. string="Time Off" icon="fa-plane"
  258. class="oe_stat_button"
  259. groups="base.group_no_one"/>
  260. <button name="%(resource_resource_action_from_calendar)d" type="action"
  261. string="Work Resources" icon="fa-cogs"
  262. class="oe_stat_button"
  263. groups="base.group_user"/>
  264. </div>
  265. <h1>
  266. <field name="name"/>
  267. </h1>
  268. <group name="resource_details">
  269. <group>
  270. <field name="active" invisible="1"/>
  271. <field name="company_id" groups="base.group_multi_company"/>
  272. <field name="hours_per_day" widget="float_time"/>
  273. <field name="tz" widget="timezone_mismatch" options="{'tz_offset_field': 'tz_offset', 'mismatch_title': 'Timezone Mismatch : This timezone is different from that of your browser.\nPlease, be mindful of this when setting the working hours or the time off.'}" />
  274. <field name="tz_offset" invisible="1"/>
  275. </group>
  276. </group>
  277. <notebook>
  278. <page string="Working Hours" name="working_hours">
  279. <field name="two_weeks_explanation" attrs="{'invisible':[('two_weeks_calendar', '=', False)]}"/>
  280. <field name="attendance_ids" widget="section_one2many"/>
  281. </page>
  282. </notebook>
  283. </sheet>
  284. </form>
  285. </field>
  286. </record>
  287. <record id="view_resource_calendar_tree" model="ir.ui.view">
  288. <field name="name">resource.calendar.tree</field>
  289. <field name="model">resource.calendar</field>
  290. <field name="arch" type="xml">
  291. <tree string="Working Time">
  292. <field name="name" string="Working Time"/>
  293. <field name="company_id" groups="base.group_multi_company"/>
  294. </tree>
  295. </field>
  296. </record>
  297. <record id="action_resource_calendar_form" model="ir.actions.act_window">
  298. <field name="name">Working Times</field>
  299. <field name="res_model">resource.calendar</field>
  300. <field name="view_mode">tree,form</field>
  301. <field name="view_id" eval="False"/>
  302. <field name="search_view_id" ref="view_resource_calendar_search"/>
  303. <field name="help" type="html">
  304. <p class="o_view_nocontent_smiling_face">
  305. Define working hours and time table that could be scheduled to your project members
  306. </p>
  307. </field>
  308. </record>
  309. <!-- MENU ITEMS -->
  310. <menuitem id="menu_resource_config" name="Resource"
  311. parent="base.menu_custom"
  312. sequence="30"/>
  313. <menuitem id="menu_resource_calendar"
  314. parent="menu_resource_config"
  315. action="action_resource_calendar_form"
  316. sequence="1"/>
  317. <menuitem id="menu_view_resource_calendar_leaves_search"
  318. parent="menu_resource_config"
  319. action="action_resource_calendar_leave_tree"
  320. sequence="2"/>
  321. <menuitem id="menu_resource_resource"
  322. parent="menu_resource_config"
  323. action="action_resource_resource_tree"
  324. sequence="3"/>
  325. </odoo>