hr_timesheet_views.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="timesheet_view_search" model="ir.ui.view">
  4. <field name="name">account.analytic.line.search</field>
  5. <field name="model">account.analytic.line</field>
  6. <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//field[@name='task_id']" position="after">
  9. <field name="order_id" string="Sales Order" groups="sales_team.group_sale_salesman"/>
  10. <field name="so_line" groups="sales_team.group_sale_salesman"/>
  11. </xpath>
  12. <xpath expr="//filter[@name='month']" position="before">
  13. <filter name="billable_fixed" string="Billed at a Fixed Price" domain="[('timesheet_invoice_type', '=', 'billable_fixed')]"
  14. groups="sales_team.group_sale_salesman"/>
  15. <filter name="billable_time" string="Billed on Timesheets" domain="[('timesheet_invoice_type', '=', 'billable_time')]"
  16. groups="sales_team.group_sale_salesman"/>
  17. <filter name="billable_milestones" string="Billed on Milestones" domain="[('timesheet_invoice_type', '=', 'billable_milestones')]"
  18. groups="sales_team.group_sale_salesman"/>
  19. <filter name="billable_manual" string="Billed Manually" domain="[('timesheet_invoice_type', '=', 'billable_manual')]"
  20. groups="sales_team.group_sale_salesman"/>
  21. <filter name="non_billable" string="Non-Billable" domain="[('timesheet_invoice_type', '=', 'non_billable')]"
  22. groups="sales_team.group_sale_salesman"/>
  23. <separator/>
  24. </xpath>
  25. <xpath expr="//filter[@name='groupby_employee']" position="after">
  26. <filter string="Sales Order" name="groupby_sale_order" domain="[]" context="{'group_by': 'order_id'}"
  27. groups="sales_team.group_sale_salesman"/>
  28. <filter string="Sales Order Item" name="groupby_sale_order_item" domain="[]" context="{'group_by': 'so_line'}"
  29. groups="sales_team.group_sale_salesman"/>
  30. <filter string="Invoice" name="groupby_invoice" domain="[]" context="{'group_by': 'timesheet_invoice_id'}"
  31. groups="sales_team.group_sale_salesman"/>
  32. <filter string="Billing Type" name="groupby_timesheet_invoice_type" domain="[]"
  33. context="{'group_by': 'timesheet_invoice_type'}" groups="sales_team.group_sale_salesman"/>
  34. </xpath>
  35. </field>
  36. </record>
  37. <record id="hr_timesheet_line_tree_inherit" model="ir.ui.view">
  38. <field name="name">account.analytic.line.tree.inherit</field>
  39. <field name="model">account.analytic.line</field>
  40. <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
  41. <field name="arch" type="xml">
  42. <xpath expr="//tree/field[@name='name']" position="after">
  43. <field name="commercial_partner_id" invisible="1" groups="sales_team.group_sale_salesman"/>
  44. <field name="is_so_line_edited" invisible="1" groups="sales_team.group_sale_salesman"/>
  45. <field name="so_line" widget="so_line_field" optional="hide" options="{'no_create': True}" context="{'create': False, 'edit': False, 'delete': False}" groups="sales_team.group_sale_salesman"/>
  46. </xpath>
  47. </field>
  48. </record>
  49. <record id="hr_timesheet_line_form_inherit" model="ir.ui.view">
  50. <field name="name">account.analytic.line.form.inherit</field>
  51. <field name="model">account.analytic.line</field>
  52. <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
  53. <field name="arch" type="xml">
  54. <xpath expr="//field[@name='task_id']" position="after">
  55. <field name="commercial_partner_id" invisible="1" groups="sales_team.group_sale_salesman"/>
  56. <field name="is_so_line_edited" invisible="1" groups="sales_team.group_sale_salesman"/>
  57. <field name="so_line" widget="so_line_field" options='{"no_create": True}' context="{'create': False, 'edit': False, 'delete': False}" groups="sales_team.group_sale_salesman"/>
  58. </xpath>
  59. </field>
  60. </record>
  61. <record id="view_hr_timesheet_line_pivot_billing_rate" model="ir.ui.view">
  62. <field name="name">account.analytic.line.pivot.billing.rate</field>
  63. <field name="model">account.analytic.line</field>
  64. <field name="arch" type="xml">
  65. <pivot string="Timesheets" sample="1">
  66. <field name="date" interval="month" type="row"/>
  67. <field name="timesheet_invoice_type" type="col"/>
  68. <field name="unit_amount" type="measure" widget="timesheet_uom"/>
  69. <field name="amount" string="Timesheet Costs"/>
  70. </pivot>
  71. </field>
  72. </record>
  73. <record id="view_hr_timesheet_line_graph_employee_per_date" model="ir.ui.view">
  74. <field name="name">account.analytic.line.graph.employee.per.date</field>
  75. <field name="model">account.analytic.line</field>
  76. <field name="arch" type="xml">
  77. <graph string="Timesheet" sample="1" js_class="hr_timesheet_graphview">
  78. <field name="date" interval="month" />
  79. <field name="employee_id"/>
  80. <field name="amount" type="measure" string="Timesheet Costs"/>
  81. <field name="unit_amount" type="measure" widget="timesheet_uom"/>
  82. </graph>
  83. </field>
  84. </record>
  85. <!--
  86. Timesheet from Sales Order
  87. -->
  88. <record id="timesheet_action_from_sales_order" model="ir.actions.act_window">
  89. <field name="name">Timesheets</field>
  90. <field name="res_model">account.analytic.line</field>
  91. <field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
  92. <field name="context">{
  93. "is_timesheet": 1,
  94. }</field>
  95. <field name="domain">[('project_id', '!=', False)]</field>
  96. </record>
  97. <record id="timesheet_action_from_sales_order_tree" model="ir.actions.act_window.view">
  98. <field name="sequence" eval="4"/>
  99. <field name="view_mode">tree</field>
  100. <field name="view_id" ref="hr_timesheet.timesheet_view_tree_user"/>
  101. <field name="act_window_id" ref="timesheet_action_from_sales_order"/>
  102. </record>
  103. <record id="timesheet_action_from_sales_order_form" model="ir.actions.act_window.view">
  104. <field name="sequence" eval="5"/>
  105. <field name="view_mode">form</field>
  106. <field name="view_id" ref="hr_timesheet.timesheet_view_form_user"/>
  107. <field name="act_window_id" ref="timesheet_action_from_sales_order"/>
  108. </record>
  109. <!-- Timesheets from Sales Order Item -->
  110. <record id="timesheet_action_from_sales_order_item" model="ir.actions.act_window">
  111. <field name="name">Timesheets</field>
  112. <field name="res_model">account.analytic.line</field>
  113. <field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
  114. <field name="domain">[('project_id', '!=', False), ('so_line', '=', active_id)]</field>
  115. <field name="context">{
  116. 'search_default_billable_timesheet': True,
  117. 'search_default_week': 1,
  118. 'default_so_line': active_id,
  119. 'default_is_so_line_edited': True,
  120. "is_timesheet": 1,
  121. }</field>
  122. <field name="help" type="html">
  123. <p class="o_view_nocontent_smiling_face">
  124. No activities found. Let's start a new one!
  125. </p>
  126. <p>
  127. Track your working hours by projects every day and invoice this time to your customers.
  128. </p>
  129. </field>
  130. </record>
  131. <record id="timesheet_action_from_sales_order_item_tree" model="ir.actions.act_window.view">
  132. <field name="sequence" eval="10"/>
  133. <field name="view_mode">tree</field>
  134. <field name="view_id" ref="hr_timesheet.timesheet_view_tree_user"/>
  135. <field name="act_window_id" ref="timesheet_action_from_sales_order_item"/>
  136. </record>
  137. <record id="timesheet_action_from_sales_order_item_kanban" model="ir.actions.act_window.view">
  138. <field name="sequence" eval="20"/>
  139. <field name="view_mode">kanban</field>
  140. <field name="view_id" ref="hr_timesheet.view_kanban_account_analytic_line"/>
  141. <field name="act_window_id" ref="timesheet_action_from_sales_order_item"/>
  142. </record>
  143. <record id="timesheet_action_from_sales_order_item_pivot" model="ir.actions.act_window.view">
  144. <field name="sequence" eval="30"/>
  145. <field name="view_mode">pivot</field>
  146. <field name="view_id" ref="hr_timesheet.view_hr_timesheet_line_pivot"/>
  147. <field name="act_window_id" ref="timesheet_action_from_sales_order_item"/>
  148. </record>
  149. <record id="timesheet_action_from_sales_order_item_graph" model="ir.actions.act_window.view">
  150. <field name="sequence" eval="40"/>
  151. <field name="view_mode">graph</field>
  152. <field name="view_id" ref="view_hr_timesheet_line_graph_employee_per_date"/>
  153. <field name="act_window_id" ref="timesheet_action_from_sales_order_item"/>
  154. </record>
  155. <record id="timesheet_action_from_sales_order_item_form" model="ir.actions.act_window.view">
  156. <field name="sequence" eval="50"/>
  157. <field name="view_mode">form</field>
  158. <field name="view_id" ref="hr_timesheet.timesheet_view_form_user"/>
  159. <field name="act_window_id" ref="timesheet_action_from_sales_order_item"/>
  160. </record>
  161. <!--
  162. Plan
  163. -->
  164. <record id="timesheet_action_plan_pivot" model="ir.actions.act_window">
  165. <field name="name">Timesheet</field>
  166. <field name="res_model">account.analytic.line</field>
  167. <field name="view_mode">pivot,tree,form</field>
  168. <field name="domain">[('project_id', '!=', False)]</field>
  169. <field name="context">{
  170. "is_timesheet": 1,
  171. }</field>
  172. <field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
  173. </record>
  174. <record id="timesheet_action_from_plan" model="ir.actions.act_window">
  175. <field name="name">Timesheet</field>
  176. <field name="res_model">account.analytic.line</field>
  177. <field name="view_mode">tree,form</field>
  178. <field name="domain">[('project_id', '!=', False)]</field>
  179. <field name="context">{
  180. "is_timesheet": 1,
  181. }</field>
  182. <field name="search_view_id" ref="hr_timesheet.hr_timesheet_line_search"/>
  183. </record>
  184. </odoo>