_auto = False
_description = "CRM Lead Report"
- def _get_data(self, cr, uid, ids, field_name, arg, context={}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of case and section Data’s IDs
- @param context: A standard dictionary for contextual values """
-
- res = {}
- avg_ans = 0.0
-
- for case in self.browse(cr, uid, ids, context):
- if field_name != 'avg_answers':
- state = field_name[5:]
- cr.execute("select count(id) from crm_lead where \
- section_id =%s and state='%s'"%(case.section_id.id, state))
- state_cases = cr.fetchone()[0]
- perc_state = (state_cases / float(case.nbr)) * 100
-
- res[case.id] = perc_state
- else:
- model_name = self._name.split('report.')
- if len(model_name) < 2:
- res[case.id] = 0.0
- else:
- model_name = model_name[1]
-
- cr.execute("select count(id) from crm_case_log l, ir_model m \
- where l.model_id=m.id and m.model = '%s'" , model_name)
- logs = cr.fetchone()[0]
-
- avg_ans = logs / case.nbr
- res[case.id] = avg_ans
-
- return res
-
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'channel_id':fields.many2one('res.partner.canal', 'Channel', readonly=True),
'type_id':fields.many2one('crm.case.resource.type', 'Campaign', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
- 'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
- 'perc_done': fields.function(_get_data, string='%Done', method=True, type="float"),
- 'perc_cancel': fields.function(_get_data, string='%Cancel', method=True, type="float"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
c.planned_revenue,
c.planned_revenue*(c.probability/100) as probable_revenue,
1 as nbr,
- 0 as avg_answers,
- 0.0 as perc_done,
- 0.0 as perc_cancel,
(SELECT count(id) FROM mailgate_message WHERE model='crm.lead' AND res_id=c.id AND history=True) AS email,
date_trunc('day',c.create_date) as create_date,
extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
<field name="email" sum="# Mails"/>
<field name="delay_open"/>
<field name="delay_close"/>
- <field name="avg_answers"/>
</tree>
</field>
</record>
_description = "Phone calls by user and section"
_auto = False
- def _get_data(self, cr, uid, ids, field_name, arg, context={}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of case and section Data’s IDs
- @param context: A standard dictionary for contextual values """
-
- res = {}
- state_perc = 0.0
- avg_ans = 0.0
-
- for case in self.browse(cr, uid, ids, context):
- if field_name != 'avg_answers':
- state = field_name[5:]
- cr.execute("select count(*) from crm_lead where \
- section_id =%s and state='%s'"%(case.section_id.id, state))
- state_cases = cr.fetchone()[0]
- perc_state = (state_cases / float(case.nbr)) * 100
-
- res[case.id] = perc_state
- else:
- model_name = self._name.split('report.')
- if len(model_name) < 2:
- res[case.id] = 0.0
- else:
- model_name = model_name[1]
-
- cr.execute("select count(*) from crm_case_log l, ir_model m \
- where l.model_id=m.id and m.model = '%s'" , model_name)
- logs = cr.fetchone()[0]
-
- avg_ans = logs / case.nbr
- res[case.id] = avg_ans
-
- return res
-
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'nbr': fields.integer('# of Cases', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
- 'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
- 'perc_done': fields.function(_get_data, string='%Done', method=True, type="float"),
- 'perc_cancel': fields.function(_get_data, string='%Cancel', method=True, type="float"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
c.company_id,
c.priority,
1 as nbr,
- 0 as avg_answers,
- 0.0 as perc_done,
- 0.0 as perc_cancel,
date_trunc('day',c.create_date) as create_date,
extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
msgstr "Recruitments Statistics"
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_done:0
-msgid "%Done"
-msgstr "%Done"
-
-#. module: hr_recruitment
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Invalid XML for View Architecture!"
msgstr "Availability (Days)"
#. module: hr_recruitment
-#: field:hr.recruitment.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr "Avg. Answers"
-
-#. module: hr_recruitment
#: view:hr.recruitment.report:0
msgid "Available"
msgstr "Available"
msgstr "Stages"
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_cancel:0
-msgid "%Cancel"
-msgstr "%Cancel"
-
-#. module: hr_recruitment
#: field:hr.applicant,probability:0
msgid "Probability"
msgstr "Probability"
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_done:0
-msgid "%Done"
-msgstr ""
-
-#. module: hr_recruitment
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr ""
-
-#. module: hr_recruitment
#: view:hr.recruitment.report:0
msgid "Available"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_cancel:0
-msgid "%Cancel"
-msgstr ""
-
-#. module: hr_recruitment
#: field:hr.applicant,probability:0
msgid "Probability"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_done:0
-msgid "%Done"
-msgstr ""
-
-#. module: hr_recruitment
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_cancel:0
-msgid "%Cancel"
-msgstr ""
-
-#. module: hr_recruitment
#: field:hr.applicant,probability:0
msgid "Probability"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_done:0
-msgid "%Done"
-msgstr ""
-
-#. module: hr_recruitment
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr ""
-
-#. module: hr_recruitment
#: view:hr.recruitment.report:0
msgid "Available"
msgstr ""
msgstr ""
#. module: hr_recruitment
-#: field:hr.recruitment.report,perc_cancel:0
-msgid "%Cancel"
-msgstr ""
-
-#. module: hr_recruitment
#: field:hr.applicant,probability:0
msgid "Probability"
msgstr ""
_auto = False
_rec_name = 'date'
- def _get_data(self, cr, uid, ids, field_name, arg, context={}):
-
- """ @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of case and section Data’s IDs
- @param context: A standard dictionary for contextual values """
-
- res = {}
- state_perc = 0.0
- avg_ans = 0.0
- #TODO: Calculate avg_answer, perc_done, perc_cancel
- return res
-
_columns = {
'user_id':fields.many2one('res.users', 'User', readonly=True),
'nbr': fields.integer('# of Cases', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
- 'avg_answers': fields.function(_get_data, string='Avg. Answers', method=True, type="integer"),
- 'perc_done': fields.function(_get_data, string='%Done', method=True, type="float"),
- 'perc_cancel': fields.function(_get_data, string='%Cancel', method=True, type="float"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
msgstr "Section"
#. module: project_issue
-#: field:project.issue.report,perc_done:0
-msgid "%Done"
-msgstr "%Done"
-
-#. module: project_issue
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Invalid XML for View Architecture!"
msgstr "Channel"
#. module: project_issue
-#: field:project.issue.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr "Avg. Answers"
-
-#. module: project_issue
#: selection:project.issue,priority:0
#: selection:project.issue.report,priority:0
msgid "Lowest"
msgstr "Tasks"
#. module: project_issue
-#: field:project.issue.report,perc_cancel:0
-msgid "%Cancel"
-msgstr "%Cancel"
-
-#. module: project_issue
#: field:project.issue.report,nbr:0
msgid "# of Issues"
msgstr "# of Issues"
msgstr ""
#. module: project_issue
-#: field:project.issue.report,perc_done:0
-msgid "%Done"
-msgstr ""
-
-#. module: project_issue
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr ""
#. module: project_issue
-#: field:project.issue.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr ""
-
-#. module: project_issue
#: selection:project.issue,priority:0
#: selection:project.issue.report,priority:0
msgid "Lowest"
msgstr ""
#. module: project_issue
-#: field:project.issue.report,perc_cancel:0
-msgid "%Cancel"
-msgstr ""
-
-#. module: project_issue
#: field:project.issue.report,nbr:0
msgid "# of Issues"
msgstr ""
msgstr ""
#. module: project_issue
-#: field:project.issue.report,perc_done:0
-msgid "%Done"
-msgstr ""
-
-#. module: project_issue
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr ""
#. module: project_issue
-#: field:project.issue.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr ""
-
-#. module: project_issue
#: selection:project.issue,priority:0
#: selection:project.issue.report,priority:0
msgid "Lowest"
msgstr ""
#. module: project_issue
-#: field:project.issue.report,perc_cancel:0
-msgid "%Cancel"
-msgstr ""
-
-#. module: project_issue
#: field:project.issue.report,nbr:0
msgid "# of Issues"
msgstr ""
msgstr "Sekcja"
#. module: project_issue
-#: field:project.issue.report,perc_done:0
-msgid "%Done"
-msgstr "%Wykonano"
-
-#. module: project_issue
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Niewłaściwy XML dla architektury widoku!"
msgstr "Kanał"
#. module: project_issue
-#: field:project.issue.report,avg_answers:0
-msgid "Avg. Answers"
-msgstr "Śred. odpowiedzi"
-
-#. module: project_issue
#: selection:project.issue,priority:0
#: selection:project.issue.report,priority:0
msgid "Lowest"
msgstr "Zadania"
#. module: project_issue
-#: field:project.issue.report,perc_cancel:0
-msgid "%Cancel"
-msgstr "%Anulowanych"
-
-#. module: project_issue
#: field:project.issue.report,nbr:0
msgid "# of Issues"
msgstr "# problemów"
msgstr ""
#. module: project_issue
-#: field:project.issue.report,perc_done:0
-msgid "%Done"
-msgstr ""
-
-#. module: project_issue
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
msgstr ""
#. module: project_issue
-#: field:project.issue.report,perc_cancel:0
-msgid "%Cancel"
-msgstr ""
-
-#. module: project_issue
#: field:project.issue.report,nbr:0
msgid "# of Issues"
msgstr ""
_name = "project.issue.report"
_auto = False
- def _get_data(self, cr, uid, ids, field_names, arg, context=None):
- if context is None:
- context = {}
- """ @param cr: the current row, from the database cursor,
- @param uid: the current users ID for security checks,
- @param ids: List of case and section Datas IDs
- @param context: A standard dictionary for contextual values """
-
- res = {}
-
- for report in self.browse(cr, uid, ids, context):
- res[report.id]= {
- 'avg_answers': 0.0,
- 'perc_done' : 0.0,
- 'perc_cancel': 0.0
- }
- #TODO: Calculate
-
- return res
-
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True),
- 'avg_answers': fields.function(_get_data, group_operator='avg', string='Avg. Answers', multi='avg_answers', method=True, type="integer"),
- 'perc_done': fields.function(_get_data, group_operator='avg', string='%Done', multi='perc_done', method=True, type="float"),
- 'perc_cancel': fields.function(_get_data, group_operator='avg', string='%Cancel', multi='perc_cancel', method=True, type="float"),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
'creation_date': fields.date('Creation Date', readonly=True),
'date_closed': fields.date('Date of Closing', readonly=True),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"),
- 'type_id': fields.many2one ('project.task.type', 'Stage'),
+ 'type_id': fields.many2one('project.task.type', 'Stage'),
'nbr': fields.integer('# of Issues', readonly=True),
'working_hours_open': fields.float('Avg. Working Hours to Open', readonly=True),
'working_hours_close': fields.float('Avg. Working Hours to Close', readonly=True),