Skip to content
Snippets Groups Projects
Commit 3f0fc721 authored by Martin Geubelle's avatar Martin Geubelle
Browse files

[REF] sales_team, web: remove sales_team_dashboard view

The view `sale_team_dashboard` (which extends kanban) has been removed
and replaced by a default kanban view.

To use it in the ViewManager, an option `js_class` is added
on the arch description and this class be used as the View.

This avoids creating a new view type just for one view.
parent 76c7041c
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,3 @@ import crm_team
import res_partner
import res_users
import res_config
import ir_ui_view
\ No newline at end of file
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class View(models.Model):
_inherit = 'ir.ui.view'
type = fields.Selection(selection_add=[('sales_team_dashboard', 'Sales Team Dashboard')])
......@@ -51,7 +51,7 @@
<field name="name">Dashboard</field>
<field name="res_model">crm.team</field>
<field name="view_type">form</field>
<field name="view_mode">sales_team_dashboard,form</field>
<field name="view_mode">kanban,form</field>
<field name="context">{}</field>
<field name="view_id" ref="crm_team_salesteams_search"/>
<field name="help" type="html">
......
......@@ -4,7 +4,7 @@
<field name="name">crm.team.dashboard</field>
<field name="model">crm.team</field>
<field name="arch" type="xml">
<sales_team_dashboard class="oe_background_grey o_kanban_dashboard o_salesteam_kanban" create="0">
<kanban class="oe_background_grey o_kanban_dashboard o_salesteam_kanban" create="0" js_class="sales_team_dashboard">
<field name="name"/>
<field name="user_id"/>
<field name="member_ids"/>
......@@ -58,7 +58,7 @@
</div>
</t>
</templates>
</sales_team_dashboard>
</kanban>
</field>
</record>
......
......@@ -274,7 +274,8 @@ var ViewManager = Widget.extend(ControlPanelMixin, {
},
create_view: function(view, view_options) {
var self = this;
var View = this.registry.get(view.type);
var js_class = view.fields_view.arch.attrs && view.fields_view.arch.attrs.js_class;
var View = this.registry.get(js_class || view.type);
var options = _.clone(view.options);
if (view.type === "form" && ((this.action.target === 'new' || this.action.target === 'inline') ||
(view_options && view_options.mode === 'edit'))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment