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.

333 lines
18 KiB

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_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="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_calls" model="mail.wall.widgets.widget">
  223. <field name="name">Calls</field>
  224. <field name="model_id" ref="crm.model_crm_phonecall"/>
  225. <field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
  226. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></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="type">list</field>
  229. <field name="limit">10</field>
  230. <field name="order">date DESC</field>
  231. <field name="active" eval="True"/>
  232. </record>
  233. <record id="widget_calls_all" model="mail.wall.widgets.widget">
  234. <field name="name">Calls [ALL]</field>
  235. <field name="model_id" ref="crm.model_crm_phonecall"/>
  236. <field name="domain">[('user_id', '=', user.id),('state', 'not in', ['cancel'])]</field>
  237. <field name="content"><![CDATA[${record.name} - <b>${record.partner_id.name}</b>, ${record.date}]]></field>
  238. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
  239. <field name="type">list</field>
  240. <field name="limit">10</field>
  241. <field name="order">date DESC</field>
  242. <field name="active" eval="True"/>
  243. </record>
  244. <record id="widget_meetings" model="mail.wall.widgets.widget">
  245. <field name="name">Meetings</field>
  246. <field name="model_id" ref="calendar.model_calendar_event"/>
  247. <field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
  248. <field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
  249. <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)]"/>
  250. <field name="type">list</field>
  251. <field name="limit">10</field>
  252. <field name="order">start_datetime DESC</field>
  253. <field name="active" eval="True"/>
  254. </record>
  255. <record id="widget_meetings_all" model="mail.wall.widgets.widget">
  256. <field name="name">Meetings [ALL]</field>
  257. <field name="model_id" ref="calendar.model_calendar_event"/>
  258. <field name="domain">[('partner_ids', 'in', [user.partner_id.id])]</field>
  259. <field name="content"><![CDATA[${record.name} - ${record.start_datetime}]]></field>
  260. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_management'), 0)]"/>
  261. <field name="type">list</field>
  262. <field name="limit">10</field>
  263. <field name="order">start_datetime DESC</field>
  264. <field name="active" eval="True"/>
  265. </record>
  266. <record id="widget_sales_funnel" model="mail.wall.widgets.widget">
  267. <field name="name">Conversion Rate</field>
  268. <field name="model_id" ref="crm.model_crm_lead"/>
  269. <field name="domain">[('user_id','=', user.id), ('sales_funnel_type', 'in', ['won', 'lost'])]</field>
  270. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  271. <field name="type">funnel</field>
  272. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  273. <field name="value_field_monetary" eval="True"/>
  274. <field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
  275. <field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
  276. <field name="active" eval="True"/>
  277. </record>
  278. <record id="widget_sales_funnel_all" model="mail.wall.widgets.widget">
  279. <field name="name">Conversion Rate [ALL]</field>
  280. <field name="model_id" ref="crm.model_crm_lead"/>
  281. <field name="domain">[('sales_funnel_type', 'in', ['won', 'lost'])]</field>
  282. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_management'), 0)]"/>
  283. <field name="type">funnel</field>
  284. <field name="value_field_id" ref="crm.field_crm_lead_planned_revenue"/>
  285. <field name="value_field_monetary" eval="True"/>
  286. <field name="stage_field_id" ref="sale_mediation_custom.field_crm_lead_stage_closed_id"/>
  287. <field name="won_domain">[('sales_funnel_type', 'in', ['won'])]</field>
  288. <field name="active" eval="True"/>
  289. </record>
  290. <record id="widget_sales_contributed" model="mail.wall.widgets.widget">
  291. <field name="name">Sales contributed</field>
  292. <field name="model_id" ref="sale.model_sale_order"/>
  293. <field name="domain">[('state', 'in', ['done'])]</field>
  294. <field name="won_domain">[('user_id','=', user.id), ('state', 'in', ['done'])]</field>
  295. <field name="group_ids" eval="[(4, ref('mail_wall_custom.group_dashboard_sales_person'), 0)]"/>
  296. <field name="type">slice</field>
  297. <field name="value_field_id" ref="sale.field_sale_order_amount_total"/>
  298. <field name="value_field_monetary" eval="True"/>
  299. <field name="active" eval="True"/>
  300. </record>
  301. <!--
  302. <record id="goal_average_deal_time" model="gamification.goal.definition">
  303. <field name="name">Average deal time</field>
  304. <field name="description"></field>
  305. <field name="monetary" eval="False"/>
  306. <field name="suffix"></field>
  307. <field name="computation_mode"></field>
  308. <field name="display_mode">progress</field>
  309. <field name="condition">higher</field>
  310. <field name="domain"></field>
  311. <field name="model_id" ref="crm.model_crm_lead"/>
  312. <field name="field_id" ref="sale_mediation_custom.field_crm_lead_deal_time"/>
  313. </record>
  314. -->
  315. </data>
  316. </openerp>