[IMP] crm: Add Campaign source and medium in group by + fix a bug when name_search return a tuple and not only the id.
This commit is contained in:
parent
db20a45186
commit
053d32d817
|
@ -87,7 +87,9 @@ class crm_tracking_mixin(osv.AbstractModel):
|
|||
if value:
|
||||
Model = self.pool[column._obj]
|
||||
rel_id = Model.name_search(cr, uid, value, context=context)
|
||||
if not rel_id:
|
||||
if rel_id:
|
||||
rel_id = Model.name_search(cr, uid, value, context=context)[0][0]
|
||||
else:
|
||||
rel_id = Model.create(cr, uid, {'name': value}, context=context)
|
||||
vals[field] = rel_id
|
||||
# Here the code for other cases that many2one
|
||||
|
|
|
@ -349,6 +349,9 @@
|
|||
<filter string="Sales Team" domain="[]" context="{'group_by':'section_id'}" groups="base.group_multi_salesteams"/>
|
||||
<filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Campaign" domain="[]" context="{'group_by':'campaign_id'}"/>
|
||||
<filter string="Source" domain="[]" context="{'group_by':'source_id'}"/>
|
||||
<filter string="Channel" domain="[]" context="{'group_by':'medium_id'}"/>
|
||||
<filter string="Expected Closing" domain="[]" context="{'group_by':'date_deadline:week'}"/>
|
||||
<filter string="Last Message" name="group_message_last_post" domain="[]" context="{'group_by':'message_last_post:week'}"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue