19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models,fields, api, _
from odoo import _, models
class CrmTeam(models.Model):
@ -10,35 +9,10 @@ class CrmTeam(models.Model):
def _compute_dashboard_button_name(self):
super(CrmTeam, self)._compute_dashboard_button_name()
teams_with_opp = self.filtered(lambda team: team.use_opportunities)
if self._context.get('in_sales_app'):
if self.env.context.get('in_sales_app'):
teams_with_opp.update({'dashboard_button_name': _("Sales Analysis")})
def action_primary_channel_button(self):
if self._context.get('in_sales_app') and self.use_opportunities:
if self.env.context.get('in_sales_app') and self.use_opportunities:
return self.env["ir.actions.actions"]._for_xml_id("sale.action_order_report_so_salesteam")
return super(CrmTeam,self).action_primary_channel_button()
def _graph_get_model(self):
if self.use_opportunities and self._context.get('in_sales_app') :
return 'sale.report'
return super(CrmTeam,self)._graph_get_model()
def _graph_date_column(self):
if self.use_opportunities and self._context.get('in_sales_app'):
return 'date'
return super(CrmTeam,self)._graph_date_column()
def _graph_y_query(self):
if self.use_opportunities and self._context.get('in_sales_app'):
return 'SUM(price_subtotal)'
return super(CrmTeam,self)._graph_y_query()
def _graph_title_and_key(self):
if self.use_opportunities and self._context.get('in_sales_app'):
return ['', _('Sales: Untaxed Total')]
return super(CrmTeam,self)._graph_title_and_key()
def _extra_sql_conditions(self):
if self.use_opportunities and self._context.get('in_sales_app'):
return "AND state in ('sale', 'done', 'pos_done')"
return super(CrmTeam,self)._extra_sql_conditions()