[FIX] website_crm: skip archived visitors in stat button
Currently stat button on crm.lead form view still shows page views count of archived visitor records. This is not coherent with the action performed when clicking which filters out archived records. We now correctly count only active visitors page count. closes odoo/odoo#87574 X-original-commit: 325aaebca2d7b6b3a0e285f957e2be5736e7c69e Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -20,7 +20,7 @@ class Lead(models.Model):
|
||||
JOIN crm_lead_website_visitor_rel lv ON l.id = lv.crm_lead_id
|
||||
JOIN website_visitor v ON v.id = lv.website_visitor_id
|
||||
JOIN website_track p ON p.visitor_id = v.id
|
||||
WHERE l.id in %s
|
||||
WHERE l.id in %s AND v.active = TRUE
|
||||
GROUP BY l.id"""
|
||||
self.env.cr.execute(sql, (tuple(self.ids),))
|
||||
page_data = self.env.cr.dictfetchall()
|
||||
|
||||
Reference in New Issue
Block a user