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.

323 lines
17 KiB

10 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record id="goal_average_payment_time" model="gamification.goal.definition">
  5. <field name="name">Average payment time</field>
  6. <field name="description"></field>
  7. <field name="monetary" eval="False"/>
  8. <field name="suffix">days</field>
  9. <field name="computation_mode">avg</field>
  10. <field name="display_mode">progress</field>
  11. <field name="model_id" ref="sale.model_sale_order"/>
  12. <field name="field_id" ref="sale_mediation_custom.field_sale_order_invoice_deal_time"/>
  13. <field name="field_date_id" ref="sale.field_sale_order_date_order"/>
  14. <field name="condition">lower</field>
  15. <field name="domain">[('user_id','=', user.id),('state','in', ['done'])]</field>
  16. </record>
  17. <record id="goal_average_payment_time_all" model="gamification.goal.definition">
  18. <field name="name">Average payment time [ALL]</field>
  19. <field name="description"></field>
  20. <field name="monetary" eval="False"/>
  21. <field name="suffix">days</field>
  22. <field name="computation_mode">avg</field>
  23. <field name="display_mode">progress</field>
  24. <field name="model_id" ref="sale.model_sale_order"/>
  25. <field name="field_id" ref="sale_mediation_custom.field_sale_order_invoice_deal_time"/>
  26. <field name="field_date_id" ref="sale.field_sale_order_date_order"/>
  27. <field name="condition">lower</field>
  28. <field name="domain">[('state','in', ['done'])]</field>
  29. </record>
  30. <record id="goal_average_deal_time" model="gamification.goal.definition">
  31. <field name="name">Average deal time</field>
  32. <field name="description"></field>
  33. <field name="monetary" eval="False"/>
  34. <field name="suffix">days</field>
  35. <field name="computation_mode">avg</field>
  36. <field name="display_mode">progress</field>
  37. <field name="model_id" ref="crm.model_crm_lead"/>
  38. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  39. <field name="field_date_id" ref="crm.field_crm_lead_create_date"/>
  40. <field name="condition">lower</field>
  41. <field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)]</field>
  42. </record>
  43. <record id="goal_average_deal_time_all" model="gamification.goal.definition">
  44. <field name="name">Average deal time [ALL]</field>
  45. <field name="description"></field>
  46. <field name="monetary" eval="False"/>
  47. <field name="suffix">days</field>
  48. <field name="computation_mode">avg</field>
  49. <field name="display_mode">progress</field>
  50. <field name="model_id" ref="crm.model_crm_lead"/>
  51. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  52. <field name="field_date_id" ref="crm.field_crm_lead_create_date"/>
  53. <field name="condition">lower</field>
  54. <field name="domain">[('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)]</field>
  55. </record>
  56. <record id="goal_oldest_lead" model="gamification.goal.definition">
  57. <field name="name">Oldest lead</field>
  58. <field name="description"></field>
  59. <field name="monetary" eval="False"/>
  60. <field name="suffix">days</field>
  61. <field name="computation_mode">max</field>
  62. <field name="display_mode">progress</field>
  63. <field name="condition">lower</field>
  64. <field name="domain">[('user_id','=', user.id), ('sales_funnel_type', '=', 'lead')]</field>
  65. <field name="model_id" ref="crm.model_crm_lead"/>
  66. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  67. </record>
  68. <record id="goal_oldest_lead_all" model="gamification.goal.definition">
  69. <field name="name">Oldest lead [ALL]</field>
  70. <field name="description"></field>
  71. <field name="monetary" eval="False"/>
  72. <field name="suffix">days</field>
  73. <field name="computation_mode">max</field>
  74. <field name="display_mode">progress</field>
  75. <field name="condition">lower</field>
  76. <field name="domain">[('sales_funnel_type', '=', 'lead')]</field>
  77. <field name="model_id" ref="crm.model_crm_lead"/>
  78. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  79. </record>
  80. <record id="goal_oldest_opp" model="gamification.goal.definition">
  81. <field name="name">Oldest Opportunity</field>
  82. <field name="description"></field>
  83. <field name="monetary" eval="False"/>
  84. <field name="suffix">days</field>
  85. <field name="computation_mode">max</field>
  86. <field name="display_mode">progress</field>
  87. <field name="condition">lower</field>
  88. <field name="domain">[('user_id','=', user.id), '|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')]</field>
  89. <field name="model_id" ref="crm.model_crm_lead"/>
  90. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  91. </record>
  92. <record id="goal_oldest_opp_all" model="gamification.goal.definition">
  93. <field name="name">Oldest Opportunity [ALL]</field>
  94. <field name="description"></field>
  95. <field name="monetary" eval="False"/>
  96. <field name="suffix">days</field>
  97. <field name="computation_mode">max</field>
  98. <field name="display_mode">progress</field>
  99. <field name="condition">lower</field>
  100. <field name="domain">['|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')]</field>
  101. <field name="model_id" ref="crm.model_crm_lead"/>
  102. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  103. </record>
  104. <record id="goal_personal_comission" model="gamification.goal.definition">
  105. <field name="name">Personal comission</field>
  106. <field name="description"></field>
  107. <field name="monetary" eval="True"/>
  108. <field name="computation_mode">python</field>
  109. <field name="display_mode">progress</field>
  110. <field name="condition">higher</field>
  111. <field name="domain">[('state','!=','cancel'),('user_id','=',user.id),('type','=','out_invoice')]</field><!-- duplicated at compute_code-->
  112. <field name="model_id" ref="account.model_account_invoice_report"/>
  113. <field name="field_id" ref="account.field_account_invoice_report_price_total"/>
  114. <field name="field_date_id" eval="ref('account.field_account_invoice_report_date')" />
  115. <field name="compute_code">
  116. personal_comission = object.user_id.employee_ids and object.user_id.employee_ids[0].personal_comission or 0.0
  117. result = object.sum * personal_comission / 100.0
  118. </field>
  119. </record>
  120. <record id="goal_team_bonus" model="gamification.goal.definition">
  121. <field name="name">Team bonus</field>
  122. <field name="description">Monthly team bonus</field>
  123. <field name="monetary" eval="True"/>
  124. <field name="computation_mode">python</field>
  125. <field name="display_mode">progress</field>
  126. <field name="condition">higher</field>
  127. <field name="domain">[('state','!=','cancel'),('section_id','=',user.default_section_id.id),('type','=','out_invoice')]</field><!-- duplicated at compute_code-->
  128. <field name="model_id" ref="account.model_account_invoice_report"/>
  129. <field name="field_id" ref="account.field_account_invoice_report_price_total"/>
  130. <field name="field_date_id" eval="ref('account.field_account_invoice_report_date')" />
  131. <field name="compute_code">
  132. <![CDATA[
  133. minimum = object.user_id.default_section_id.invoiced_forecast
  134. maximum = object.user_id.default_section_id.invoiced_target
  135. current = object.sum
  136. salary = 1000 # TODO
  137. team_bonus = object.user_id.employee_ids and object.user_id.employee_ids[0].team_bonus or 0.0
  138. if current < maximum:
  139. current = maximum
  140. if current < minimum or minimum == maximum:
  141. result = 0.0
  142. else:
  143. result = salary * (team_bonus / (12 * 100)) * (current - minimum) / (maximum - minimum)
  144. result = int(result * 100) / 100.0
  145. ]]>
  146. </field>
  147. </record>
  148. <record model="res.groups" id="group_dashboard_accountant">
  149. <field name="name">dashboard_accountant</field>
  150. <field name="category_id" ref="access_custom.module_category_custom"/>
  151. <field name="comment">Shows dashboard to accountant</field>
  152. </record>
  153. <record model="res.groups" id="group_dashboard_sales_management">
  154. <field name="name">dashboard_sales_managment</field>
  155. <field name="category_id" ref="access_custom.module_category_custom"/>
  156. <field name="comment">Shows sales management dashboard</field>
  157. </record>
  158. <record model="res.groups" id="group_dashboard_management">
  159. <field name="name">dashboard_managment</field>
  160. <field name="category_id" ref="access_custom.module_category_custom"/>
  161. <field name="comment">Shows management dashboard. It includes: sales management + accountant dashboard + EXTRA</field>
  162. <field name="implied_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management')),(4, ref('mail_wall_custom.group_dashboard_accountant'))]"/>
  163. </record>
  164. <record model="res.groups" id="group_dashboard_sales_person">
  165. <field name="name">dashboard_sales_person</field>
  166. <field name="category_id" ref="access_custom.module_category_custom"/>
  167. <field name="comment">Shows dashboard to salesperson</field>
  168. </record>
  169. <record model="res.groups" id="group_dashboard_admin">
  170. <field name="name">dashboard_admin</field>
  171. <field name="category_id" ref="access_custom.module_category_custom"/>
  172. <field name="comment">Shows admin dashboard</field>
  173. </record>
  174. <record id="widget_outstanding_invoices" model="mail.wall.widgets.widget">
  175. <field name="name">Outstanding sale orders</field>
  176. <field name="model_id" ref="sale.model_sale_order"/>
  177. <field name="domain">[('user_id', '=', user.id),('state', 'in', ['progress', 'manual'])]</field>
  178. <field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
  179. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
  180. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  181. <field name="type">list</field>
  182. <field name="active" eval="True"/>
  183. </record>
  184. <record id="widget_outstanding_invoices_all" model="mail.wall.widgets.widget">
  185. <field name="name">Outstanding sale orders [ALL]</field>
  186. <field name="model_id" ref="sale.model_sale_order"/>
  187. <field name="domain">[('state', 'in', ['progress', 'manual'])]</field>
  188. <field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
  189. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
  190. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  191. <field name="type">list</field>
  192. <field name="active" eval="True"/>
  193. </record>
  194. <record id="widget_sent_invoices_all" model="mail.wall.widgets.widget">
  195. <field name="name">Sent invoices [ALL]</field>
  196. <field name="model_id" ref="account.model_account_invoice"/>
  197. <field name="domain">[('type', 'in', ['out_invoice']),('state','in',['open'])]</field>
  198. <field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
  199. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
  200. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  201. <field name="type">list</field>
  202. <field name="active" eval="True"/>
  203. </record>
  204. <record id="widget_received_invoices_all" model="mail.wall.widgets.widget">
  205. <field name="name">Received invoices [ALL]</field>
  206. <field name="model_id" ref="account.model_account_invoice"/>
  207. <field name="domain">[('type', 'in', ['in_invoice']),('state','in',['open'])]</field>
  208. <field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
  209. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
  210. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  211. <field name="type">list</field>
  212. <field name="active" eval="True"/>
  213. </record>
  214. <record id="widget_calls" model="mail.wall.widgets.widget">
  215. <field name="name">Calls</field>
  216. <field name="model_id" ref="crm.model_crm_phonecall"/>
  217. <field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
  218. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
  219. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  220. <field name="type">list</field>
  221. <field name="limit">10</field>
  222. <field name="order">date DESC</field>
  223. <field name="active" eval="True"/>
  224. </record>
  225. <record id="widget_calls_all" model="mail.wall.widgets.widget">
  226. <field name="name">Calls [ALL]</field>
  227. <field name="model_id" ref="crm.model_crm_phonecall"/>
  228. <field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
  229. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
  230. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
  231. <field name="type">list</field>
  232. <field name="limit">10</field>
  233. <field name="order">date DESC</field>
  234. <field name="active" eval="True"/>
  235. </record>
  236. <record id="widget_meetings" model="mail.wall.widgets.widget">
  237. <field name="name">Meetings</field>
  238. <field name="model_id" ref="calendar.model_calendar_event"/>
  239. <field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
  240. <field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
  241. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0),(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_admin'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  242. <field name="type">list</field>
  243. <field name="limit">10</field>
  244. <field name="order">start_datetime DESC</field>
  245. <field name="active" eval="True"/>
  246. </record>
  247. <record id="widget_meetings_all" model="mail.wall.widgets.widget">
  248. <field name="name">Meetings [ALL]</field>
  249. <field name="model_id" ref="calendar.model_calendar_event"/>
  250. <field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
  251. <field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
  252. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
  253. <field name="type">list</field>
  254. <field name="limit">10</field>
  255. <field name="order">start_datetime DESC</field>
  256. <field name="active" eval="True"/>
  257. </record>
  258. <record id="widget_sales_funnel" model="mail.wall.widgets.widget">
  259. <field name="name">Conversion Rate</field>
  260. <field name="model_id" ref="crm.model_crm_lead"/>
  261. <field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won', 'lost'])]</field>
  262. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  263. <field name="type">funnel</field>
  264. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  265. <field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
  266. <field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
  267. <field name="active" eval="True"/>
  268. </record>
  269. <record id="widget_sales_funnel_all" model="mail.wall.widgets.widget">
  270. <field name="name">Conversion Rate [ALL]</field>
  271. <field name="model_id" ref="crm.model_crm_lead"/>
  272. <field name="domain">[('sales_funnel_type', 'in', ['won', 'lost'])]</field>
  273. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
  274. <field name="type">funnel</field>
  275. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  276. <field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
  277. <field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
  278. <field name="active" eval="True"/>
  279. </record>
  280. <record id="widget_sales_contributed" model="mail.wall.widgets.widget">
  281. <field name="name">Sales contributed</field>
  282. <field name="model_id" ref="sale.model_sale_order"/>
  283. <field name="domain">[('state', 'in', ['done'])]</field>
  284. <field name="won_domain">[('user_id','=', user.id), ('state', 'in', ['done'])]</field>
  285. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  286. <field name="type">slice</field>
  287. <field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
  288. <field name="value_field_monetary" eval="True"/>
  289. <field name="active" eval="True"/>
  290. </record>
  291. <!--
  292. <record id="goal_average_deal_time" model="gamification.goal.definition">
  293. <field name="name">Average deal time</field>
  294. <field name="description"></field>
  295. <field name="monetary" eval="False"/>
  296. <field name="suffix"></field>
  297. <field name="computation_mode"></field>
  298. <field name="display_mode">progress</field>
  299. <field name="condition">higher</field>
  300. <field name="domain"></field>
  301. <field name="model_id" ref="crm.model_crm_lead"/>
  302. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  303. </record>
  304. -->
  305. </data>
  306. </openerp>