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.

402 lines
22 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
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_last_action_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_last_action_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_last_action_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_last_action_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="value_field_monetary" eval="True"/>
  180. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
  181. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  182. <field name="type">list</field>
  183. <field name="limit">10</field>
  184. <field name="active" eval="True"/>
  185. </record>
  186. <record id="widget_outstanding_invoices_all" model="mail.wall.widgets.widget">
  187. <field name="name">Outstanding sale orders [ALL]</field>
  188. <field name="model_id" ref="sale.model_sale_order"/>
  189. <field name="domain">[('state', 'in', ['progress', 'manual'])]</field>
  190. <field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
  191. <field name="value_field_monetary" eval="True"/>
  192. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_order}]]></field>
  193. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  194. <field name="type">list</field>
  195. <field name="limit">10</field>
  196. <field name="active" eval="True"/>
  197. </record>
  198. <record id="widget_sent_invoices_all" model="mail.wall.widgets.widget">
  199. <field name="name">Sent invoices [ALL]</field>
  200. <field name="model_id" ref="account.model_account_invoice"/>
  201. <field name="domain">[('type', 'in', ['out_invoice']),('state','in',['open'])]</field>
  202. <field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
  203. <field name="value_field_monetary" eval="True"/>
  204. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
  205. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  206. <field name="type">list</field>
  207. <field name="limit">10</field>
  208. <field name="active" eval="True"/>
  209. </record>
  210. <record id="widget_received_invoices_all" model="mail.wall.widgets.widget">
  211. <field name="name">Received invoices [ALL]</field>
  212. <field name="model_id" ref="account.model_account_invoice"/>
  213. <field name="domain">[('type', 'in', ['in_invoice']),('state','in',['open'])]</field>
  214. <field name="value_field_id" ref="account.field_account_invoice_amount_total"/>
  215. <field name="value_field_monetary" eval="True"/>
  216. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date_invoice}]]></field>
  217. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  218. <field name="type">list</field>
  219. <field name="limit">10</field>
  220. <field name="active" eval="True"/>
  221. </record>
  222. <record id="widget_tasks" model="mail.wall.widgets.widget">
  223. <field name="name">Task deadlines</field>
  224. <field name="model_id" ref="project.model_project_task"/>
  225. <field name="domain">[('user_id', '=', user.id),('date_deadline','!=',False)]</field>
  226. <field name="content"><![CDATA[${record.name} - <b>${record.project_id and record.project_id.name or 'NO PROJECT'}</b>, ${record.date_deadline}]]></field>
  227. <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)]"/>
  228. <field name="agenda" eval="True"/>
  229. <field name="field_date_id" ref="project.field_project_task_date_deadline"/>
  230. <field name="type">list</field>
  231. <field name="limit">10</field>
  232. <field name="order">priority DESC</field>
  233. <field name="active" eval="True"/>
  234. </record>
  235. <record id="widget_tasks_all" model="mail.wall.widgets.widget">
  236. <field name="name">Task deadlines [ALL]</field>
  237. <field name="model_id" ref="project.model_project_task"/>
  238. <field name="domain">[('date_deadline','!=',False)]</field>
  239. <field name="content"><![CDATA[${record.name} - <b>${record.project_id and record.project_id.name or 'NO PROJECT'}</b>, ${record.date_deadline}]]></field>
  240. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0),(4, ref('mail_wall_custom.group_dashboard_accountant'), 0)]"/>
  241. <field name="agenda" eval="True"/>
  242. <field name="field_date_id" ref="project.field_project_task_date_deadline"/>
  243. <field name="type">list</field>
  244. <field name="limit">10</field>
  245. <field name="order">priority DESC</field>
  246. <field name="active" eval="True"/>
  247. </record>
  248. <record id="widget_next_action" model="mail.wall.widgets.widget">
  249. <field name="name">Next action</field>
  250. <field name="model_id" ref="crm.model_crm_lead"/>
  251. <field name="domain">[('user_id', '=', user.id), '|',('date_action','!=',False),('title_action', '!=', False)]</field>
  252. <field name="content"><![CDATA[${record.name}: <b>${record.date_action}</b> - ${record.title_action}]]></field>
  253. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  254. <field name="agenda" eval="True"/>
  255. <field name="field_date_id" ref="crm.field_crm_lead_date_action"/>
  256. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  257. <field name="value_field_monetary" eval="True"/>
  258. <field name="type">list</field>
  259. <field name="limit">10</field>
  260. <field name="order">priority DESC,probability DESC,planned_revenue DESC</field>
  261. <field name="active" eval="True"/>
  262. </record>
  263. <record id="widget_next_action_all" model="mail.wall.widgets.widget">
  264. <field name="name">Next action [ALL]</field>
  265. <field name="model_id" ref="crm.model_crm_lead"/>
  266. <field name="domain">['|',('date_action','!=',False),('title_action', '!=', False)]</field>
  267. <field name="content"><![CDATA[${record.name}: <b>${record.date_action}</b> - ${record.title_action}]]></field>
  268. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
  269. <field name="agenda" eval="True"/>
  270. <field name="field_date_id" ref="crm.field_crm_lead_date_action"/>
  271. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  272. <field name="value_field_monetary" eval="True"/>
  273. <field name="type">list</field>
  274. <field name="limit">10</field>
  275. <field name="order">priority DESC,probability DESC,planned_revenue DESC</field>
  276. <field name="active" eval="True"/>
  277. </record>
  278. <record id="widget_calls" model="mail.wall.widgets.widget">
  279. <field name="name">Calls</field>
  280. <field name="model_id" ref="crm.model_crm_phonecall"/>
  281. <field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
  282. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
  283. <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)]"/>
  284. <field name="agenda" eval="True"/>
  285. <field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
  286. <field name="type">list</field>
  287. <field name="limit">10</field>
  288. <field name="order">date DESC</field>
  289. <field name="active" eval="True"/>
  290. </record>
  291. <record id="widget_calls_all" model="mail.wall.widgets.widget">
  292. <field name="name">Calls [ALL]</field>
  293. <field name="model_id" ref="crm.model_crm_phonecall"/>
  294. <field name="domain">[('state', 'not in', ['cancel'])]</field>
  295. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
  296. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
  297. <field name="agenda" eval="True"/>
  298. <field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
  299. <field name="type">list</field>
  300. <field name="limit">10</field>
  301. <field name="order">date DESC</field>
  302. <field name="active" eval="True"/>
  303. </record>
  304. <record id="widget_meetings" model="mail.wall.widgets.widget">
  305. <field name="name">Meetings</field>
  306. <field name="model_id" ref="calendar.model_calendar_event"/>
  307. <field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
  308. <field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
  309. <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)]"/>
  310. <field name="agenda" eval="True"/>
  311. <field name="field_date_id" ref="calendar.field_calendar_event_start_datetime"/>
  312. <field name="type">list</field>
  313. <field name="limit">10</field>
  314. <field name="order">start_datetime DESC</field>
  315. <field name="active" eval="True"/>
  316. </record>
  317. <record id="widget_meetings_all" model="mail.wall.widgets.widget">
  318. <field name="name">Meetings [ALL]</field>
  319. <field name="model_id" ref="calendar.model_calendar_event"/>
  320. <field name="domain">[]</field>
  321. <field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
  322. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
  323. <field name="agenda" eval="True"/>
  324. <field name="field_date_id" ref="crm.field_crm_phonecall_date"/>
  325. <field name="agenda" eval="True"/>
  326. <field name="field_date_id" ref="calendar.field_calendar_event_start_datetime"/>
  327. <field name="type">list</field>
  328. <field name="limit">10</field>
  329. <field name="order">start_datetime DESC</field>
  330. <field name="active" eval="True"/>
  331. </record>
  332. <record id="widget_sales_funnel" model="mail.wall.widgets.widget">
  333. <field name="name">Conversion Rate</field>
  334. <field name="model_id" ref="crm.model_crm_lead"/>
  335. <field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won', 'lost'])]</field>
  336. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  337. <field name="type">funnel</field>
  338. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  339. <field name="value_field_monetary" eval="True"/>
  340. <field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
  341. <field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
  342. <field name="active" eval="True"/>
  343. </record>
  344. <record id="widget_sales_funnel_all" model="mail.wall.widgets.widget">
  345. <field name="name">Conversion Rate [ALL]</field>
  346. <field name="model_id" ref="crm.model_crm_lead"/>
  347. <field name="domain">[('sales_funnel_type', 'in', ['won', 'lost'])]</field>
  348. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
  349. <field name="type">funnel</field>
  350. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  351. <field name="value_field_monetary" eval="True"/>
  352. <field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
  353. <field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
  354. <field name="active" eval="True"/>
  355. </record>
  356. <record id="widget_sales_contributed" model="mail.wall.widgets.widget">
  357. <field name="name">Sales contributed</field>
  358. <field name="model_id" ref="sale.model_sale_order"/>
  359. <field name="domain">[('state', 'in', ['done'])]</field>
  360. <field name="won_domain">[('user_id','=', user.id), ('state', 'in', ['done'])]</field>
  361. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  362. <field name="type">slice</field>
  363. <field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
  364. <field name="value_field_monetary" eval="True"/>
  365. <field name="active" eval="True"/>
  366. </record>
  367. <!--
  368. <record id="goal_average_deal_time" model="gamification.goal.definition">
  369. <field name="name">Average deal time</field>
  370. <field name="description"></field>
  371. <field name="monetary" eval="False"/>
  372. <field name="suffix"></field>
  373. <field name="computation_mode"></field>
  374. <field name="display_mode">progress</field>
  375. <field name="condition">higher</field>
  376. <field name="domain"></field>
  377. <field name="model_id" ref="crm.model_crm_lead"/>
  378. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_last_action_time"/>
  379. </record>
  380. -->
  381. </data>
  382. </openerp>