| 1 |
|
| 2 |
|
| 3 |
from odoo import _, models |
| 4 |
|
| 5 |
|
| 6 |
class CrmTeam(models.Model): |
| 7 |
_inherit = 'crm.team' |
| 8 |
|
| 9 |
def _compute_dashboard_button_name(self): |
| 10 |
super(CrmTeam, self)._compute_dashboard_button_name() |
| 11 |
teams_with_opp = self.filtered(lambda team: team.use_opportunities) |
| 12 |
if self.env.context.get('in_sales_app'): |
| 13 |
teams_with_opp.update({'dashboard_button_name': _("Sales Analysis")}) |
| 14 |
|
| 15 |
def action_primary_channel_button(self): |
| 16 |
if self.env.context.get('in_sales_app') and self.use_opportunities: |
| 17 |
return self.env["ir.actions.actions"]._for_xml_id("sale.action_order_report_so_salesteam") |
| 18 |
return super(CrmTeam,self).action_primary_channel_button() |