[CHANGE] change opp assign reporter with assign date instead of creation date + remove find similar partner with lead name
bzr revid: tfr@openerp.com-20110401122520-389zigbr34qe9u2m
This commit is contained in:
parent
f3433d30aa
commit
609d962b97
|
@ -91,8 +91,7 @@ class crm_lead2partner(osv.osv_memory):
|
|||
# Find partner name that matches the name of the lead
|
||||
if not partner_ids and lead.partner_name:
|
||||
partner_ids = partner_obj.search(cr, uid, [('name', '=', lead.partner_name)], context=context)
|
||||
if not partner_ids:
|
||||
partner_ids = partner_obj.search(cr, uid, [('name', '=', lead.name)], context=context)
|
||||
|
||||
|
||||
partner_id = partner_ids and partner_ids[0] or False
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class crm_lead_report_assign(osv.osv):
|
|||
_auto = False
|
||||
_description = "CRM Lead Report"
|
||||
_columns = {
|
||||
'name': fields.char('Year', size=64, required=False, readonly=True),
|
||||
'year': fields.char('Year', size=64, required=False, readonly=True),
|
||||
'partner_assigned_id':fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'grade_id':fields.many2one('res.partner.grade', 'Grade', readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
|
@ -51,7 +51,7 @@ class crm_lead_report_assign(osv.osv):
|
|||
('09', 'September'), ('10', 'October'),\
|
||||
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'partner_date': fields.date('Partner Date', readonly=True),
|
||||
'date_assign': fields.date('Partner Date', readonly=True),
|
||||
'create_date': fields.datetime('Create Date', readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'delay_open': fields.float('Delay to Open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
|
||||
|
@ -82,18 +82,20 @@ class crm_lead_report_assign(osv.osv):
|
|||
CRM Lead Report
|
||||
@param cr: the current row, from the database cursor
|
||||
"""
|
||||
print "WHATTT "
|
||||
tools.drop_view_if_exists(cr, 'crm_lead_report_assign')
|
||||
cr.execute("""
|
||||
CREATE OR REPLACE VIEW crm_lead_report_assign AS (
|
||||
SELECT
|
||||
c.id,
|
||||
to_char(c.create_date, 'YYYY') as name,
|
||||
to_char(c.create_date, 'MM') as month,
|
||||
to_char(c.create_date, 'YYYY-MM-DD') as day,
|
||||
to_char(c.date_assign, 'YYYY') as year,
|
||||
to_char(c.date_assign, 'MM') as month,
|
||||
to_char(c.date_assign, 'YYYY-MM-DD') as day,
|
||||
to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
|
||||
to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
|
||||
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
|
||||
c.state,
|
||||
c.date_assign,
|
||||
c.user_id,
|
||||
c.probability,
|
||||
c.probability as probability_max,
|
||||
|
|
|
@ -69,17 +69,17 @@
|
|||
domain="[]"
|
||||
context="{'group_by':'company_id'}" />
|
||||
<separator orientation="vertical" />
|
||||
<filter string="Partner Date" icon="terp-go-today"
|
||||
<filter string="Assign Date" icon="terp-go-today"
|
||||
domain="[]"
|
||||
name="group_partner_date"
|
||||
context="{'group_by':'partner_date'}"/>
|
||||
context="{'group_by':'date_assign'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-go-today"
|
||||
domain="[]" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month"
|
||||
domain="[]" context="{'group_by':'month'}" />
|
||||
<filter string="Year" icon="terp-go-year"
|
||||
domain="[]" context="{'group_by':'name'}" />
|
||||
domain="[]" context="{'group_by':'year'}" />
|
||||
</group>
|
||||
|
||||
</search>
|
||||
|
@ -107,9 +107,9 @@
|
|||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Opportunities Assignment Analysis">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="partner_date" invisible="1"/>
|
||||
<field name="date_assign" invisible="1"/>
|
||||
<field name="section_id" invisible="1" groups="base.group_extended"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="grade_id" invisible="1" widget="selection"/>
|
||||
|
|
Loading…
Reference in New Issue