19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:53 +01:00
parent dc68f80d3f
commit 7221b9ac46
610 changed files with 135477 additions and 161677 deletions

View file

@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, tools, api
from odoo import fields, models, tools
class ActivityReport(models.Model):
class CrmActivityReport(models.Model):
""" CRM Lead Analysis """
_name = "crm.activity.report"
_name = 'crm.activity.report'
_auto = False
_description = "CRM Activity Analysis"
_rec_name = 'id'
@ -33,6 +33,12 @@ class ActivityReport(models.Model):
selection=[('lead', 'Lead'), ('opportunity', 'Opportunity')],
help="Type is used to separate Leads and Opportunities")
active = fields.Boolean('Active', readonly=True)
tag_ids = fields.Many2many(related="lead_id.tag_ids", readonly=True)
won_status = fields.Selection([
('won', 'Won'),
('lost', 'Lost'),
('pending', 'Pending'),
], string='Is Won', readonly=True)
def _select(self):
return """
@ -55,7 +61,8 @@ class ActivityReport(models.Model):
l.stage_id,
l.partner_id,
l.type as lead_type,
l.active
l.active,
l.won_status
"""
def _from(self):
@ -69,15 +76,14 @@ class ActivityReport(models.Model):
"""
def _where(self):
disccusion_subtype = self.env.ref('mail.mt_comment')
return """
WHERE
m.model = 'crm.lead' AND (m.mail_activity_type_id IS NOT NULL OR m.subtype_id = %s)
""" % (disccusion_subtype.id,)
m.model = 'crm.lead' AND (m.mail_activity_type_id IS NOT NULL)
"""
def init(self):
tools.drop_view_if_exists(self._cr, self._table)
self._cr.execute("""
tools.drop_view_if_exists(self.env.cr, self._table)
self.env.cr.execute("""
CREATE OR REPLACE VIEW %s AS (
%s
%s