commit ade5442f0dbf3e2b2fc69b5c889a3ec14f49d29d Author: Ivan Yelizariev Date: Thu Jan 8 19:06:57 2015 +0200 upload "dashboard" modules diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..bff786c --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +import models diff --git a/__openerp__.py b/__openerp__.py new file mode 100644 index 0000000..70b8f40 --- /dev/null +++ b/__openerp__.py @@ -0,0 +1,28 @@ +{ + 'name' : 'Custom mail wall', + 'version' : '1.0.0', + 'author' : 'Ivan Yelizariev', + 'category' : 'Custom', + 'website' : 'https://it-projects.info', + 'description': """ + +Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d + """, + 'depends' : ['gamification', + 'gamification_extra', + 'hr', + 'sale', + 'sales_team', + 'crm', + 'calendar', + 'project', + 'mail_wall_widgets', + 'sale_mediation_custom', + 'access_custom', + ], + 'data':[ + 'views.xml', + 'data.xml', + ], + 'installable': True, +} diff --git a/data.xml b/data.xml new file mode 100644 index 0000000..93bf771 --- /dev/null +++ b/data.xml @@ -0,0 +1,210 @@ + + + + + Average payment time + + + days + avg + progress + + + + lower + [('user_id','=', user.id),('state','in', ['done'])] + + + Average deal time + + + days + avg + progress + + + + lower + [('user_id','=', user.id), ('sales_funnel_type', 'in', ['won']), ('date_closed', '!=', False)] + + + Oldest lead + + + days + max + progress + lower + [('user_id','=', user.id), ('sales_funnel_type', '=', 'lead')] + + + + + Oldest Opportunity + + + days + max + progress + lower + [('user_id','=', user.id), '|', ('sales_funnel_type', '=', 'quotation'),('sales_funnel_type', '=', 'negotiation')] + + + + + + Personal comission + + + python + progress + higher + [('state','!=','cancel'),('user_id','=',user.id),('type','=','out_invoice')] + + + + +personal_comission = object.user_id.employee_ids and object.user_id.employee_ids[0].personal_comission or 0.0 +result = object.sum * personal_comission / 100.0 + + + + + Team bonus + Monthly team bonus + + python + progress + higher + [('state','!=','cancel'),('section_id','=',user.default_section_id.id),('type','=','out_invoice')] + + + + + + + + + + dashboard_sales_person + + Shows dashboard to salesperson + + + dashboard_managment + + Shows management dashboard + + + + Outstanding sale orders + + [('user_id', '=', user.id),('state', 'in', ['progress', 'manual'])] + + ${record.partner_id.name}, ${record.date_order}]]> + + list + + + + + Sent invoices + + [('user_id', '=', user.id),('type', 'in', ['out_invoice']),('state','in',['open'])] + + ${record.partner_id.name}, ${record.date_invoice}]]> + + list + + + + + Received invoices + + [('user_id', '=', user.id),('type', 'in', ['in_invoice']),('state','in',['open'])] + + ${record.partner_id.name}, ${record.date_invoice}]]> + + list + + + + + Calls + + [('user_id', '=', user.id),('state', 'not in', ['cancel'])] + ${record.partner_id.name}, ${record.date}]]> + + list + 10 + date DESC + + + + + Mettings + + [('partner_ids', 'in', [user.partner_id.id])] + + + list + 10 + start_datetime DESC + + + + + Conversion Rate + + [('user_id','=', user.id), ('sales_funnel_type', 'in', ['won', 'lost'])] + + funnel + + + [('sales_funnel_type', 'in', ['won'])] + + + + + Sales contributed + + [('state', 'in', ['done'])] + [('user_id','=', user.id), ('state', 'in', ['done'])] + + slice + + + + + + + + + diff --git a/models.py b/models.py new file mode 100644 index 0000000..0d8b14f --- /dev/null +++ b/models.py @@ -0,0 +1,13 @@ +from openerp import api,models,fields +from openerp.osv import fields as old_fields + +class hr_employee(models.Model): + _inherit = 'hr.employee' + + default_section_id = fields.Many2one('crm.case.section', 'Default Sales Team', related='user_id.default_section_id') + + personal_comission = fields.Float('Personal comission', help='Personal comission for sales. Value 1.0 is equal 1%') + + team_bonus = fields.Float('Team bonus', help='Maximum team bonus (per year). Value 1.0 is equal 1%') + + company_bonus = fields.Float('Company bonus', help='Maximum team bonus (per year). Value 1.0 is equal 1%') diff --git a/views.xml b/views.xml new file mode 100644 index 0000000..3cee23b --- /dev/null +++ b/views.xml @@ -0,0 +1,20 @@ + + + + + hr.employee.form + hr.employee + + + + + + + + + + + + + +