[Fix] add email field analyse claim report
bzr revid: sbh@tinyerp.com-20101223105516-ivc4ub35nkw0r6i9
This commit is contained in:
parent
abd780fd52
commit
b4e84192bb
|
@ -73,6 +73,7 @@ class crm_claim_report(osv.osv):
|
|||
'date_closed': fields.date('Close Date', readonly=True),
|
||||
'date_deadline': fields.date('Deadline', readonly=True),
|
||||
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
|
||||
'email': fields.integer('# Emails', size=128, readonly=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
|
@ -103,13 +104,14 @@ class crm_claim_report(osv.osv):
|
|||
c.type_action as type_action,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
|
||||
(SELECT count(id) FROM mailgate_message WHERE model='crm.helpdesk' AND res_id=c.id AND history=True) AS email,
|
||||
extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24) as delay_expected
|
||||
from
|
||||
crm_claim c
|
||||
group by to_char(c.date, 'YYYY'), to_char(c.date, 'MM'),to_char(c.date, 'YYYY-MM-DD'),\
|
||||
c.state, c.user_id,c.section_id, c.stage_id,\
|
||||
c.categ_id,c.partner_id,c.company_id,c.create_date,
|
||||
c.priority,c.type_action,c.date_deadline,c.date_closed
|
||||
c.priority,c.type_action,c.date_deadline,c.date_closed,c.id
|
||||
)""")
|
||||
|
||||
crm_claim_report()
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
<field name="day" invisible="1"/>
|
||||
<field name="nbr" string="#Claim" sum="#Claim"/>
|
||||
<field name="delay_close" avg="Avg Closing Delay"/>
|
||||
<field name="email"/>
|
||||
<field name="delay_expected"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="stage_id" invisible="1"/>
|
||||
|
|
Loading…
Reference in New Issue