[IMP] sales_team: lint module
PURPOSE Prepare enhancements of sales team membership. SPECIFICATIONS Linting containing * reorder fields according to their use; * order methods according to guidelines (compute, CRUD, actions, tools); * fix some docstrings and typos; * remove unused imports and dead code; * rename files according to guidelines; * move views in their own file for mail.activity and assets; * correctly name data and demo files; * rename some inner methods to ease understanding; LINKS Task ID 2086889 (sales team enhancements) Task ID 2234698 (preparation lint) Community PR odoo/odoo#49520
This commit is contained in:
@@ -1,26 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
{
|
||||
'name': 'Sales Teams',
|
||||
'version': '1.0',
|
||||
'category': 'Sales/Sales',
|
||||
'summary': 'Sales Teams',
|
||||
'description': """
|
||||
Using this application you can manage Sales Teams with CRM and/or Sales
|
||||
===========================================================================
|
||||
Using this application you can manage Sales Teams with CRM and/or Sales
|
||||
=======================================================================
|
||||
""",
|
||||
'website': 'https://www.odoo.com/page/crm',
|
||||
'depends': ['base', 'mail'],
|
||||
'data': ['security/sales_team_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/sales_team_data.xml',
|
||||
'views/crm_team_views.xml',
|
||||
'views/sales_team_dashboard.xml',
|
||||
'views/crm_tag_views.xml',
|
||||
],
|
||||
'demo': ['data/sales_team_demo.xml',
|
||||
'data/crm_tag_demo.xml',
|
||||
],
|
||||
'data': [
|
||||
'security/sales_team_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'data/crm_team_data.xml',
|
||||
'views/assets.xml',
|
||||
'views/crm_tag_views.xml',
|
||||
'views/crm_team_views.xml',
|
||||
'views/mail_activity_views.xml',
|
||||
],
|
||||
'demo': [
|
||||
'data/crm_team_demo.xml',
|
||||
'data/crm_tag_demo.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
@@ -1,39 +1,38 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<odoo><data noupdate="1">
|
||||
|
||||
<!-- crm categories -->
|
||||
<record id="categ_oppor1" model="crm.tag">
|
||||
<field name="name">Product</field>
|
||||
<field name="color" eval="1"/>
|
||||
</record>
|
||||
<record id="categ_oppor2" model="crm.tag">
|
||||
<field name="name">Software</field>
|
||||
<field name="color" eval="2"/>
|
||||
</record>
|
||||
<record id="categ_oppor3" model="crm.tag">
|
||||
<field name="name">Services</field>
|
||||
<field name="color" eval="3"/>
|
||||
</record>
|
||||
<record id="categ_oppor4" model="crm.tag">
|
||||
<field name="name">Information</field>
|
||||
<field name="color" eval="4"/>
|
||||
</record>
|
||||
<record id="categ_oppor5" model="crm.tag">
|
||||
<field name="name">Design</field>
|
||||
<field name="color" eval="5"/>
|
||||
</record>
|
||||
<record id="categ_oppor6" model="crm.tag">
|
||||
<field name="name">Training</field>
|
||||
<field name="color" eval="6"/>
|
||||
</record>
|
||||
<record id="categ_oppor7" model="crm.tag">
|
||||
<field name="name">Consulting</field>
|
||||
<field name="color" eval="7"/>
|
||||
</record>
|
||||
<record id="categ_oppor8" model="crm.tag">
|
||||
<field name="name">Other</field>
|
||||
<field name="color" eval="8"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
<!-- crm categories -->
|
||||
<record id="categ_oppor1" model="crm.tag">
|
||||
<field name="name">Product</field>
|
||||
<field name="color" eval="1"/>
|
||||
</record>
|
||||
<record id="categ_oppor2" model="crm.tag">
|
||||
<field name="name">Software</field>
|
||||
<field name="color" eval="2"/>
|
||||
</record>
|
||||
<record id="categ_oppor3" model="crm.tag">
|
||||
<field name="name">Services</field>
|
||||
<field name="color" eval="3"/>
|
||||
</record>
|
||||
<record id="categ_oppor4" model="crm.tag">
|
||||
<field name="name">Information</field>
|
||||
<field name="color" eval="4"/>
|
||||
</record>
|
||||
<record id="categ_oppor5" model="crm.tag">
|
||||
<field name="name">Design</field>
|
||||
<field name="color" eval="5"/>
|
||||
</record>
|
||||
<record id="categ_oppor6" model="crm.tag">
|
||||
<field name="name">Training</field>
|
||||
<field name="color" eval="6"/>
|
||||
</record>
|
||||
<record id="categ_oppor7" model="crm.tag">
|
||||
<field name="name">Consulting</field>
|
||||
<field name="color" eval="7"/>
|
||||
</record>
|
||||
<record id="categ_oppor8" model="crm.tag">
|
||||
<field name="name">Other</field>
|
||||
<field name="color" eval="8"/>
|
||||
</record>
|
||||
|
||||
</data></odoo>
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
|
||||
from babel.dates import format_date
|
||||
from datetime import date, datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import json
|
||||
|
||||
from babel.dates import format_date
|
||||
from datetime import date
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import AccessError, UserError
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.release import version
|
||||
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF
|
||||
|
||||
|
||||
class CrmTeam(models.Model):
|
||||
@@ -38,32 +37,29 @@ class CrmTeam(models.Model):
|
||||
name = fields.Char('Sales Team', required=True, translate=True)
|
||||
sequence = fields.Integer('Sequence', default=10)
|
||||
active = fields.Boolean(default=True, help="If the active field is set to false, it will allow you to hide the Sales Team without removing it.")
|
||||
company_id = fields.Many2one('res.company', string='Company',
|
||||
default=lambda self: self.env.company, index=True)
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company', index=True,
|
||||
default=lambda self: self.env.company)
|
||||
currency_id = fields.Many2one(
|
||||
"res.currency", related='company_id.currency_id',
|
||||
string="Currency", readonly=True)
|
||||
"res.currency", string="Currency",
|
||||
related='company_id.currency_id', readonly=True)
|
||||
user_id = fields.Many2one('res.users', string='Team Leader', check_company=True)
|
||||
# memberships
|
||||
member_ids = fields.One2many(
|
||||
'res.users', 'sale_team_id', string='Channel Members', check_company=True,
|
||||
domain=[('share', '=', False)],
|
||||
'res.users', 'sale_team_id', string='Channel Members',
|
||||
check_company=True, domain=[('share', '=', False)],
|
||||
help="Add members to automatically assign their documents to this sales team. You can only be member of one team.")
|
||||
# UX options
|
||||
color = fields.Integer(string='Color Index', help="The color of the channel")
|
||||
favorite_user_ids = fields.Many2many(
|
||||
'res.users', 'team_favorite_user_rel', 'team_id', 'user_id',
|
||||
string='Favorite Members',
|
||||
default=_get_default_favorite_user_ids)
|
||||
string='Favorite Members', default=_get_default_favorite_user_ids)
|
||||
is_favorite = fields.Boolean(
|
||||
string='Show on dashboard',
|
||||
compute='_compute_is_favorite', inverse='_inverse_is_favorite',
|
||||
string='Show on dashboard', compute='_compute_is_favorite', inverse='_inverse_is_favorite',
|
||||
help="Favorite teams to display them in the dashboard and access them easily.")
|
||||
color = fields.Integer(string='Color Index', help="The color of the channel")
|
||||
dashboard_button_name = fields.Char(string="Dashboard Button", compute='_compute_dashboard_button_name')
|
||||
dashboard_graph_data = fields.Text(compute='_compute_dashboard_graph')
|
||||
|
||||
def _compute_dashboard_graph(self):
|
||||
for team in self:
|
||||
team.dashboard_graph_data = json.dumps(team._get_graph())
|
||||
|
||||
def _compute_is_favorite(self):
|
||||
for team in self:
|
||||
team.is_favorite = self.env.user in team.favorite_user_ids
|
||||
@@ -75,6 +71,65 @@ class CrmTeam(models.Model):
|
||||
(sudoed_self - to_fav).write({'favorite_user_ids': [(3, self.env.uid)]})
|
||||
return True
|
||||
|
||||
def _compute_dashboard_button_name(self):
|
||||
""" Sets the adequate dashboard button name depending on the Sales Team's options
|
||||
"""
|
||||
for team in self:
|
||||
team.dashboard_button_name = _("Big Pretty Button :)") # placeholder
|
||||
|
||||
def _compute_dashboard_graph(self):
|
||||
for team in self:
|
||||
team.dashboard_graph_data = json.dumps(team._get_dashboard_graph_data())
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# CRUD
|
||||
# ------------------------------------------------------------
|
||||
|
||||
@api.model
|
||||
def create(self, values):
|
||||
team = super(CrmTeam, self.with_context(mail_create_nosubscribe=True)).create(values)
|
||||
if values.get('member_ids'):
|
||||
team._add_members_to_favorites()
|
||||
return team
|
||||
|
||||
def write(self, values):
|
||||
res = super(CrmTeam, self).write(values)
|
||||
if values.get('member_ids'):
|
||||
self._add_members_to_favorites()
|
||||
return res
|
||||
|
||||
def unlink(self):
|
||||
default_teams = [
|
||||
self.env.ref('sales_team.salesteam_website_sales'),
|
||||
self.env.ref('sales_team.pos_sales_team'),
|
||||
self.env.ref('sales_team.ebay_sales_team')
|
||||
]
|
||||
for team in self:
|
||||
if team in default_teams:
|
||||
raise UserError(_('Cannot delete default team "%s"' % (team.name)))
|
||||
return super(CrmTeam,self).unlink()
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# ACTIONS
|
||||
# ------------------------------------------------------------
|
||||
|
||||
def action_primary_channel_button(self):
|
||||
""" Skeleton function to be overloaded It will return the adequate action
|
||||
depending on the Sales Team's options. """
|
||||
return False
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# TOOLS
|
||||
# ------------------------------------------------------------
|
||||
|
||||
def _add_members_to_favorites(self):
|
||||
for team in self:
|
||||
team.favorite_user_ids = [(4, member.id) for member in team.member_ids]
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# GRAPH
|
||||
# ------------------------------------------------------------
|
||||
|
||||
def _graph_get_model(self):
|
||||
""" skeleton function defined here because it'll be called by crm and/or sale
|
||||
"""
|
||||
@@ -146,7 +201,7 @@ class CrmTeam(models.Model):
|
||||
self._cr.execute(query, [self.id, start_date, end_date] + where_clause_params)
|
||||
return self.env.cr.dictfetchall()
|
||||
|
||||
def _get_graph(self):
|
||||
def _get_dashboard_graph_data(self):
|
||||
def get_week_name(start_date, locale):
|
||||
""" Generates a week name (string) from a datetime according to the locale:
|
||||
E.g.: locale start_date (datetime) return string
|
||||
@@ -183,43 +238,3 @@ class CrmTeam(models.Model):
|
||||
[graph_title, graph_key] = self._graph_title_and_key()
|
||||
color = '#875A7B' if '+e' in version else '#7c7bad'
|
||||
return [{'values': values, 'area': True, 'title': graph_title, 'key': graph_key, 'color': color}]
|
||||
|
||||
def _compute_dashboard_button_name(self):
|
||||
""" Sets the adequate dashboard button name depending on the Sales Team's options
|
||||
"""
|
||||
for team in self:
|
||||
team.dashboard_button_name = _("Big Pretty Button :)") # placeholder
|
||||
|
||||
def action_primary_channel_button(self):
|
||||
""" skeleton function to be overloaded
|
||||
It will return the adequate action depending on the Sales Team's options
|
||||
"""
|
||||
return False
|
||||
|
||||
@api.model
|
||||
def create(self, values):
|
||||
team = super(CrmTeam, self.with_context(mail_create_nosubscribe=True)).create(values)
|
||||
if values.get('member_ids'):
|
||||
team._add_members_to_favorites()
|
||||
return team
|
||||
|
||||
def write(self, values):
|
||||
res = super(CrmTeam, self).write(values)
|
||||
if values.get('member_ids'):
|
||||
self._add_members_to_favorites()
|
||||
return res
|
||||
|
||||
def unlink(self):
|
||||
default_teams = [
|
||||
self.env.ref('sales_team.salesteam_website_sales'),
|
||||
self.env.ref('sales_team.pos_sales_team'),
|
||||
self.env.ref('sales_team.ebay_sales_team')
|
||||
]
|
||||
for team in self:
|
||||
if team in default_teams:
|
||||
raise UserError(_('Cannot delete default team "%s"' % (team.name)))
|
||||
return super(CrmTeam,self).unlink()
|
||||
|
||||
def _add_members_to_favorites(self):
|
||||
for team in self:
|
||||
team.favorite_user_ids = [(4, member.id) for member in team.member_ids]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="assets_backend" name="sales_team assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" type="text/scss" href="/sales_team/static/src/scss/sales_team_dashboard.scss"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -1,182 +1,244 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<odoo><data>
|
||||
|
||||
<!-- Sales Teams Search view -->
|
||||
<record id="crm_team_salesteams_search" model="ir.ui.view">
|
||||
<field name="name">Sales Teams - Search</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Salesteams Search">
|
||||
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Team Leader" name="team_leader" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="crm_team_salesteams_search" model="ir.ui.view">
|
||||
<field name="name">Sales Teams - Search</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Salesteams Search">
|
||||
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Team Leader" name="team_leader" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sales Teams Action -->
|
||||
<record id="crm_team_salesteams_act" model="ir.actions.act_window">
|
||||
<field name="name">Sales Teams</field>
|
||||
<field name="res_model">crm.team</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="crm_team_salesteams_search"/>
|
||||
<field name="context">{'in_sales_app': True}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Define a new sales team
|
||||
</p><p>
|
||||
Use Sales Teams to organize your sales departments.
|
||||
Each team will work with a separate pipeline.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="crm_team_salesteams_pipelines_act" model="ir.actions.act_window">
|
||||
<field name="name">Team Pipelines</field>
|
||||
<field name="res_model">crm.team</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="crm_team_salesteams_search"/>
|
||||
<field name="context">{}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Define a new sales team
|
||||
</p><p>
|
||||
Use Sales Teams to organize your sales departments.
|
||||
Each team will work with a separate pipeline.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sales Teams Form View -->
|
||||
|
||||
<record id="crm_team_view_form" model="ir.ui.view">
|
||||
<field name="name">crm.team.form</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sales Team">
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box"/>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only" string="Sales Team"/>
|
||||
<h1>
|
||||
<field name="name" placeholder="Sales Team name..."/>
|
||||
</h1>
|
||||
<div name="options_active" />
|
||||
</div>
|
||||
<group>
|
||||
<group name="left">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="user_id" domain="[('share', '=', False)]"/>
|
||||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
<group name="right">
|
||||
</group>
|
||||
<record id="crm_team_view_form" model="ir.ui.view">
|
||||
<field name="name">crm.team.form</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sales Team">
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box"/>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only" string="Sales Team"/>
|
||||
<h1>
|
||||
<field name="name" placeholder="Sales Team name..."/>
|
||||
</h1>
|
||||
<div name="options_active" />
|
||||
</div>
|
||||
<group>
|
||||
<group name="left">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="user_id" domain="[('share', '=', False)]"/>
|
||||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="members" string="Team Members" >
|
||||
<field name="member_ids" widget="many2many" options="{'not_delete': True}">
|
||||
<kanban quick_create="false" create="true" delete="true">
|
||||
<field name="id"/>
|
||||
<field name="name"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click" style="max-width: 200px">
|
||||
<div class="o_kanban_record_top">
|
||||
<img t-att-src="kanban_image('res.users', 'image_128', record.id.raw_value)" class="oe_avatar oe_kanban_avatar_smallbox o_image_40_cover mb0" alt="Avatar"/>
|
||||
<div class="o_kanban_record_headings ml8">
|
||||
<strong class="o_kanban_record_title"><field name="name"/></strong>
|
||||
</div>
|
||||
<group name="right">
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="members" string="Team Members" >
|
||||
<field name="member_ids" widget="many2many" options="{'not_delete': True}">
|
||||
<kanban quick_create="false" create="true" delete="true">
|
||||
<field name="id"/>
|
||||
<field name="name"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click" style="max-width: 200px">
|
||||
<div class="o_kanban_record_top">
|
||||
<img t-att-src="kanban_image('res.users', 'image_128', record.id.raw_value)" class="oe_avatar oe_kanban_avatar_smallbox o_image_40_cover mb0" alt="Avatar"/>
|
||||
<div class="o_kanban_record_headings ml8">
|
||||
<strong class="o_kanban_record_title"><field name="name"/></strong>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers" help="Follow this salesteam to automatically track the events associated to users of this team."/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers" help="Follow this salesteam to automatically track the events associated to users of this team."/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sales Teams Tree View -->
|
||||
<record id="crm_team_view_tree" model="ir.ui.view">
|
||||
<field name="name">crm.team.tree</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="field_parent">child_ids</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sales Team">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="crm_team_view_tree" model="ir.ui.view">
|
||||
<field name="name">crm.team.tree</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="field_parent">child_ids</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sales Team">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Sales Teams Kanban View -->
|
||||
<record id="crm_team_view_kanban" model="ir.ui.view">
|
||||
<field name="name">crm.team.kanban</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<strong><field name="name"/></strong>
|
||||
<record id="crm_team_view_kanban" model="ir.ui.view">
|
||||
<field name="name">crm.team.kanban</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_content oe_kanban_global_click">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<strong><field name="name"/></strong>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<span class="float-right"><field name="user_id"/></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Case Teams Salesteams dashboard view -->
|
||||
<record id="crm_team_salesteams_view_kanban" model="ir.ui.view" >
|
||||
<field name="name">crm.team.dashboard</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="oe_background_grey o_kanban_dashboard o_salesteam_kanban" create="0">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="member_ids"/>
|
||||
<field name="color"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="is_favorite"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}">
|
||||
<div t-attf-class="o_kanban_card_header">
|
||||
<div class="o_kanban_card_header_title">
|
||||
<div class="o_primary"><field name="name"/></div>
|
||||
</div>
|
||||
<div class="o_kanban_manage_button_section">
|
||||
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container o_kanban_card_content">
|
||||
<div class="row o_kanban_card_upper_content">
|
||||
<div class="col-5 o_kanban_primary_left" name="to_replace_in_sale_crm">
|
||||
<button type="object" class="btn btn-primary" name="action_primary_channel_button"><field name="dashboard_button_name"/></button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<span class="float-right"><field name="user_id"/></span>
|
||||
<div class="col-7 o_kanban_primary_right" style="padding-bottom:0;">
|
||||
<t name="first_options"/>
|
||||
<t name="second_options"/>
|
||||
<t name="third_options"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 o_kanban_primary_bottom">
|
||||
<t t-call="SalesTeamDashboardGraph"/>
|
||||
</div>
|
||||
<div class="col-12 o_kanban_primary_bottom bottom_block">
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
|
||||
<div class="row">
|
||||
<div class="col-4 o_kanban_card_manage_section o_kanban_manage_view">
|
||||
<div role="menuitem" class="o_kanban_card_manage_title">
|
||||
<span>View</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 o_kanban_card_manage_section o_kanban_manage_new">
|
||||
<div role="menuitem" class="o_kanban_card_manage_title">
|
||||
<span>New</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 o_kanban_card_manage_section o_kanban_manage_reports">
|
||||
<div role="menuitem" class="o_kanban_card_manage_title">
|
||||
<span>Reporting</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div t-if="widget.editable" class="o_kanban_card_manage_settings row" groups="sales_team.group_sale_manager">
|
||||
<div role="menuitem" aria-haspopup="true" class="col-8">
|
||||
<ul class="oe_kanban_colorpicker" data-field="color" role="menu"/>
|
||||
</div>
|
||||
<div role="menuitem" class="col-4 text-right">
|
||||
<a type="edit">Settings</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="SalesTeamDashboardGraph">
|
||||
<div t-if="record.dashboard_graph_data.raw_value" class="o_sales_team_kanban_graph_section">
|
||||
<field name="dashboard_graph_data" widget="dashboard_graph" t-att-graph_type="'bar'"/>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- add css / js -->
|
||||
<template id="assets_backend" name="sales_team assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" type="text/scss" href="/sales_team/static/src/scss/sales_team_dashboard.scss"/>
|
||||
</xpath>
|
||||
</template>
|
||||
<!-- Sales Teams Actions -->
|
||||
<record id="crm_team_salesteams_act" model="ir.actions.act_window">
|
||||
<field name="name">Sales Teams</field>
|
||||
<field name="res_model">crm.team</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="crm_team_salesteams_search"/>
|
||||
<field name="context">{'in_sales_app': True}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Define a new sales team
|
||||
</p><p>
|
||||
Use Sales Teams to organize your sales departments.
|
||||
Each team will work with a separate pipeline.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sales_team_config_action" model="ir.actions.act_window">
|
||||
<field name="name">Sales Teams</field>
|
||||
<field name="res_model">crm.team</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="view_id" ref="crm_team_salesteams_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Define a new sales team
|
||||
</p><p>
|
||||
Use Sales Teams to organize your sales departments.
|
||||
Each team will work with a separate pipeline.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="crm_team_salesteams_pipelines_act" model="ir.actions.act_window">
|
||||
<field name="name">Team Pipelines</field>
|
||||
<field name="res_model">crm.team</field>
|
||||
<field name="view_mode">kanban,form</field>
|
||||
<field name="view_id" ref="crm_team_salesteams_search"/>
|
||||
<field name="context">{}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Define a new sales team
|
||||
</p><p>
|
||||
Use Sales Teams to organize your sales departments.
|
||||
Each team will work with a separate pipeline.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mail_activity_type_action_config_sales" model="ir.actions.act_window">
|
||||
<field name="name">Activity Types</field>
|
||||
<field name="res_model">mail.activity.type</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">['|', ('res_model_id', '=', False), ('res_model_id.model', '=', 'res.partner')]</field>
|
||||
</record>
|
||||
</data>
|
||||
<record id="sales_team_config_action" model="ir.actions.act_window">
|
||||
<field name="name">Sales Teams</field>
|
||||
<field name="res_model">crm.team</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="view_id" ref="crm_team_salesteams_search"/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Define a new sales team
|
||||
</p><p>
|
||||
Use Sales Teams to organize your sales departments.
|
||||
Each team will work with a separate pipeline.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="mail_activity_type_action_config_sales" model="ir.actions.act_window">
|
||||
<field name="name">Activity Types</field>
|
||||
<field name="res_model">mail.activity.type</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">['|', ('res_model_id', '=', False), ('res_model_id.model', '=', 'res.partner')]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,83 +0,0 @@
|
||||
<odoo>
|
||||
<!-- Case Teams Salesteams dashboard view -->
|
||||
<record id="crm_team_salesteams_view_kanban" model="ir.ui.view" >
|
||||
<field name="name">crm.team.dashboard</field>
|
||||
<field name="model">crm.team</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="oe_background_grey o_kanban_dashboard o_salesteam_kanban" create="0">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="member_ids"/>
|
||||
<field name="color"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="is_favorite"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''}">
|
||||
<div t-attf-class="o_kanban_card_header">
|
||||
<div class="o_kanban_card_header_title">
|
||||
<div class="o_primary"><field name="name"/></div>
|
||||
</div>
|
||||
<div class="o_kanban_manage_button_section">
|
||||
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container o_kanban_card_content">
|
||||
<div class="row o_kanban_card_upper_content">
|
||||
<div class="col-5 o_kanban_primary_left" name="to_replace_in_sale_crm">
|
||||
<button type="object" class="btn btn-primary" name="action_primary_channel_button"><field name="dashboard_button_name"/></button>
|
||||
</div>
|
||||
<div class="col-7 o_kanban_primary_right" style="padding-bottom:0;">
|
||||
<t name="first_options"/>
|
||||
<t name="second_options"/>
|
||||
<t name="third_options"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 o_kanban_primary_bottom">
|
||||
<t t-call="SalesTeamDashboardGraph"/>
|
||||
</div>
|
||||
<div class="col-12 o_kanban_primary_bottom bottom_block">
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
|
||||
<div class="row">
|
||||
<div class="col-4 o_kanban_card_manage_section o_kanban_manage_view">
|
||||
<div role="menuitem" class="o_kanban_card_manage_title">
|
||||
<span>View</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 o_kanban_card_manage_section o_kanban_manage_new">
|
||||
<div role="menuitem" class="o_kanban_card_manage_title">
|
||||
<span>New</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 o_kanban_card_manage_section o_kanban_manage_reports">
|
||||
<div role="menuitem" class="o_kanban_card_manage_title">
|
||||
<span>Reporting</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div t-if="widget.editable" class="o_kanban_card_manage_settings row" groups="sales_team.group_sale_manager">
|
||||
<div role="menuitem" aria-haspopup="true" class="col-8">
|
||||
<ul class="oe_kanban_colorpicker" data-field="color" role="menu"/>
|
||||
</div>
|
||||
<div role="menuitem" class="col-4 text-right">
|
||||
<a type="edit">Settings</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="SalesTeamDashboardGraph">
|
||||
<div t-if="record.dashboard_graph_data.raw_value" class="o_sales_team_kanban_graph_section">
|
||||
<field name="dashboard_graph_data" widget="dashboard_graph" t-att-graph_type="'bar'"/>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user