[REM]: crm*: Removed unused fields(perc_done, perc_cancel, avg_answers) + code in...
authorrpa (Open ERP) <rpa@tinyerp.com>
Tue, 5 Oct 2010 13:13:07 +0000 (18:43 +0530)
committerrpa (Open ERP) <rpa@tinyerp.com>
Tue, 5 Oct 2010 13:13:07 +0000 (18:43 +0530)
bzr revid: rpa@tinyerp.com-20101005131307-4o487rfg3gynn3sx

14 files changed:
addons/crm/report/crm_lead_report.py
addons/crm/report/crm_lead_report_view.xml
addons/crm/report/crm_phonecall_report.py
addons/hr_recruitment/i18n/en_US.po
addons/hr_recruitment/i18n/fr.po
addons/hr_recruitment/i18n/hr_recruitment.pot
addons/hr_recruitment/i18n/mn.po
addons/hr_recruitment/report/hr_recruitment_report.py
addons/project_issue/i18n/en_US.po
addons/project_issue/i18n/fr.po
addons/project_issue/i18n/nl.po
addons/project_issue/i18n/pl.po
addons/project_issue/i18n/project_issue.pot
addons/project_issue/report/project_issue_report.py

index 9cef185..5f469da 100644 (file)
@@ -37,41 +37,6 @@ class crm_lead_report(osv.osv):
     _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),
@@ -80,9 +45,6 @@ class crm_lead_report(osv.osv):
         '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'), \
@@ -147,9 +109,6 @@ class crm_lead_report(osv.osv):
                     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,
index aa0b437..249f4c1 100644 (file)
@@ -29,7 +29,6 @@
                 <field name="email" sum="# Mails"/>
                 <field name="delay_open"/>
                 <field name="delay_close"/>
-                <field name="avg_answers"/>
              </tree>
             </field>
         </record>
index 9502c39..1ee4ce8 100644 (file)
@@ -39,42 +39,6 @@ class crm_phonecall_report(osv.osv):
     _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),
@@ -82,9 +46,6 @@ class crm_phonecall_report(osv.osv):
         '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'), \
@@ -131,9 +92,6 @@ class crm_phonecall_report(osv.osv):
                     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
index e4065c4..7bd8e6c 100644 (file)
@@ -255,11 +255,6 @@ msgid "Recruitments Statistics"
 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!"
@@ -313,11 +308,6 @@ msgid "Availability (Days)"
 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"
@@ -465,11 +455,6 @@ msgid "Stages"
 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"
index becba82..16e1782 100644 (file)
@@ -258,11 +258,6 @@ msgid "Recruitments Statistics"
 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 ""
@@ -316,11 +311,6 @@ msgid "Availability (Days)"
 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 ""
@@ -468,11 +458,6 @@ msgid "Stages"
 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 ""
index 9ab2d5b..27e32ce 100644 (file)
@@ -255,11 +255,6 @@ msgid "Recruitments Statistics"
 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 ""
@@ -465,11 +460,6 @@ msgid "Stages"
 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 ""
index 9f1704c..ab849b8 100644 (file)
@@ -259,11 +259,6 @@ msgid "Recruitments Statistics"
 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 ""
@@ -317,11 +312,6 @@ msgid "Availability (Days)"
 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 ""
@@ -469,11 +459,6 @@ msgid "Stages"
 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 ""
index 2a2ab8f..405897e 100644 (file)
@@ -36,26 +36,10 @@ class hr_recruitment_report(osv.osv):
     _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'), \
index 1f4a966..20af7b0 100644 (file)
@@ -231,11 +231,6 @@ msgid "Section"
 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!"
@@ -292,11 +287,6 @@ msgid "Channel"
 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"
@@ -400,11 +390,6 @@ msgid "Tasks"
 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"
index 8da8b57..02404ea 100644 (file)
@@ -236,11 +236,6 @@ msgid "Section"
 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 ""
@@ -297,11 +292,6 @@ msgid "Channel"
 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"
@@ -408,11 +398,6 @@ msgid "Tasks"
 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 ""
index 5901943..f2f86f4 100644 (file)
@@ -237,11 +237,6 @@ msgid "Section"
 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 ""
@@ -298,11 +293,6 @@ msgid "Channel"
 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"
@@ -409,11 +399,6 @@ msgid "Tasks"
 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 ""
index be14450..52c4443 100644 (file)
@@ -241,11 +241,6 @@ msgid "Section"
 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!"
@@ -302,11 +297,6 @@ msgid "Channel"
 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"
@@ -415,11 +405,6 @@ msgid "Tasks"
 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"
index 521eefb..ec99de9 100644 (file)
@@ -231,11 +231,6 @@ msgid "Section"
 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 ""
@@ -400,11 +395,6 @@ msgid "Tasks"
 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 ""
index 5509686..ba4c285 100644 (file)
@@ -35,34 +35,11 @@ class project_issue_report(osv.osv):
     _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'), \
@@ -75,7 +52,7 @@ class project_issue_report(osv.osv):
         '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),