[MERGE]: Merge with lp:openobject-trunk-dev-addons2
authorksa (Open ERP) <ksa@tinyerp.co.in>
Wed, 6 Oct 2010 04:28:08 +0000 (09:58 +0530)
committerksa (Open ERP) <ksa@tinyerp.co.in>
Wed, 6 Oct 2010 04:28:08 +0000 (09:58 +0530)
bzr revid: ksa@tinyerp.co.in-20101006042808-udwz1cgl8wt2kbri

1  2 
addons/crm/report/crm_lead_report.py
addons/crm/report/crm_phonecall_report.py
addons/document/document.py
addons/event/event.py
addons/mail_gateway/mail_gateway.py
addons/project_issue/report/project_issue_report.py
addons/sale_crm/wizard/crm_make_sale.py
addons/stock/stock.py
addons/stock/stock_view.xml

@@@ -145,16 -107,9 +107,9 @@@ class crm_lead_report(osv.osv)
                      c.partner_id,
                      c.country_id,
                      c.planned_revenue,
--                    c.planned_revenue*(c.probability/100) as probable_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,
- <<<<<<< TREE
-                     (select count(id) from mailgate_message where res_id=c.id and model='crm.lead') as email,
- =======
                      (SELECT count(id) FROM mailgate_message WHERE model='crm.lead' AND res_id=c.id AND history=True) AS email,
- >>>>>>> MERGE-SOURCE
                      date_trunc('day',c.create_date) as create_date,
                      extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as  delay_close,
                      abs(extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24)) as  delay_expected,
@@@ -38,43 -38,7 +38,6 @@@ class crm_phonecall_report(osv.osv)
      _name = "crm.phonecall.report"
      _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),
Simple merge
Simple merge
Simple merge
@@@ -184,8 -184,10 +184,9 @@@ class crm_make_sale(osv.osv_memory)
      }
      _defaults = {
           'shop_id': _get_shop_id, 
+          'close': lambda *args: 1, 
           'partner_id': _selectPartner, 
      }
 -
  crm_make_sale()
  
  class sale_order_make_line(osv.osv_memory):
Simple merge
Simple merge