[IMP]: Improve search view for crm phonecall and opportunity report.
bzr revid: rch_open_erp-20100422133115-gx6xbw975di51l6x
This commit is contained in:
@@ -53,7 +53,10 @@ class crm_opportunity_report(osv.osv):
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'date_open': fields.datetime('Opened', readonly=True),
|
||||
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority')
|
||||
'date_deadline': fields.date('Expected Closing', readonly=True),
|
||||
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_action': fields.date('Next Action', readonly=True),
|
||||
'planned_revenue': fields.float('Expected Revenue', readonly=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -83,6 +86,9 @@ class crm_opportunity_report(osv.osv):
|
||||
c.date_closed as date_closed,
|
||||
c.date_open as date_open,
|
||||
c.priority as priority,
|
||||
c.date_action as date_action,
|
||||
c.date_deadline as date_deadline,
|
||||
sum(c.planned_revenue) as planned_revenue,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
sum(planned_revenue) as amount_revenue,
|
||||
sum((planned_revenue*probability)/100.0)::decimal(16,2) as amount_revenue_prob,
|
||||
@@ -104,7 +110,9 @@ class crm_opportunity_report(osv.osv):
|
||||
create_date,
|
||||
c.date_closed,
|
||||
c.date_open,
|
||||
c.priority
|
||||
c.priority,
|
||||
c.date_action,
|
||||
c.date_deadline
|
||||
)""")
|
||||
|
||||
crm_opportunity_report()
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="date_open" invisible="1"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="date_action" invisible="1"/>
|
||||
<field name="date_deadline" invisible="1"/>
|
||||
<field name="planned_revenue" sum="Total Expected Revenue"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -82,9 +85,13 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="priority" />
|
||||
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.opportunity')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_action" />
|
||||
<newline/>
|
||||
<field name="date_closed" />
|
||||
<field name="date_open" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date_deadline" />
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath
|
||||
|
||||
@@ -41,7 +41,9 @@ class crm_phonecall_report(osv.osv):
|
||||
'priority': fields.selection(crm_report.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'date_closed': fields.datetime('Closed', readonly=True),
|
||||
'opportunity_id': fields.many2one ('crm.opportunity', 'Opportunity'),
|
||||
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]")
|
||||
'canal_id': fields.many2one('res.partner.canal','Channel',domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.phonecall')]"),
|
||||
'duration': fields.float('Duration',readonly=True),
|
||||
'date': fields.datetime('Planned Date')
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
@@ -72,6 +74,8 @@ class crm_phonecall_report(osv.osv):
|
||||
c.date_closed as date_closed,
|
||||
c.opportunity_id as opportunity_id,
|
||||
c.canal_id as canal_id,
|
||||
c.date as date,
|
||||
sum(c.duration) as duration,
|
||||
date_trunc('day',c.create_date) as create_date,
|
||||
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
|
||||
from
|
||||
@@ -79,7 +83,7 @@ class crm_phonecall_report(osv.osv):
|
||||
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
|
||||
c.state, c.user_id,c.section_id, c.categ_id,c.partner_id,c.company_id
|
||||
,to_char(c.create_date, 'YYYY-MM-DD'),c.create_date
|
||||
,c.priority,c.date_closed,opportunity_id,canal_id
|
||||
,c.priority,c.date_closed,opportunity_id,canal_id,c.date
|
||||
)""")
|
||||
|
||||
crm_phonecall_report()
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
<field name="date_closed" invisible="1"/>
|
||||
<field name="opportunity_id" invisible="1"/>
|
||||
<field name="canal_id" invisible="1"/>
|
||||
<field name="duration" sum="Total Duration"/>
|
||||
<field name="date" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -78,8 +80,11 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="opportunity_id"/>
|
||||
<field name="canal_id" widget="selection" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<newline/>
|
||||
<field name="date_closed"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath
|
||||
@@ -92,6 +97,9 @@
|
||||
context="{'group_by':'opportunity_id'}" />
|
||||
<filter string="Channel" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'canal_id'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-sale" domain="[]"
|
||||
context="{'group_by':'partner_id'}" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user