[MIG] crm_usability from v10 to v14

New module sales_team_usability (remove translation on crm.tag, which
was in crm_usability in v10)
This commit is contained in:
Alexis de Lattre
2021-11-18 10:43:53 +01:00
parent 600acd2f26
commit 878db1d0a1
12 changed files with 80 additions and 108 deletions

View File

@@ -1,3 +1 @@
# -*- coding: utf-8 -*- from . import models
from . import crm

View File

@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*- # Copyright 2016-2021 Akretion (http://www.akretion.com)
# © 2016 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
{ {
'name': 'CRM Usability', 'name': 'CRM Usability',
'version': '10.0.1.0.0', 'version': '14.0.1.0.0',
'category': 'Customer Relationship Management', 'category': 'Customer Relationship Management',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'CRM usability enhancements', 'summary': 'CRM usability enhancements',
@@ -13,11 +12,6 @@
CRM Usability CRM Usability
============= =============
Some enhancements in the *Merge Partners* wizard:
* take into account the unaccent option of the server config file
* add optional group by on 'customer' and 'supplier' (active by default)
This module has been written by Alexis de Lattre from Akretion This module has been written by Alexis de Lattre from Akretion
<alexis.delattre@akretion.com>. <alexis.delattre@akretion.com>.
""", """,
@@ -25,9 +19,7 @@ This module has been written by Alexis de Lattre from Akretion
'website': 'http://www.akretion.com', 'website': 'http://www.akretion.com',
'depends': ['crm'], 'depends': ['crm'],
'data': [ 'data': [
#'wizard/base_partner_merge_view.xml', 'views/crm_lead.xml',
'security/crm_security.xml',
'crm_view.xml',
], ],
'installable': True, 'installable': True,
} }

View File

@@ -1,35 +0,0 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
from odoo import models, fields, api
class CrmLead(models.Model):
_inherit = 'crm.lead'
probability = fields.Float(track_visibility='onchange')
date_deadline = fields.Date(track_visibility='onchange')
# Change from 'always' to 'onchange'
planned_revenue = fields.Float(track_visibility='onchange')
type = fields.Selection(track_visibility='onchange')
name = fields.Char(track_visibility='onchange')
probable_revenue = fields.Monetary(
compute='_compute_probable_revenue',
string='Probable Revenue',
help="Probable Revenue = Expected Revenue x Probability",
currency_field='company_currency', readonly=True, store=True)
@api.multi
@api.depends('probability', 'planned_revenue')
def _compute_probable_revenue(self):
for lead in self:
rev_prob = lead.probability * lead.planned_revenue / 100.0
lead.probable_revenue = rev_prob
class CrmLeadTag(models.Model):
_inherit = 'crm.lead.tag'
name = fields.Char(translate=False)

View File

@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="crm_case_form_view_oppor" model="ir.ui.view">
<field name="name">usability.crm.lead.form.opportunity</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<field name="referred" position="after">
<field name="probable_revenue"/>
</field>
</field>
</record>
<record id="crm_case_tree_view_oppor" model="ir.ui.view">
<field name="name">usability.crm.lead.tree.opportunity</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_tree_view_oppor"/>
<field name="arch" type="xml">
<field name="probability" position="after">
<field name="probable_revenue" sum="Total Probable Revenue"/>
</field>
</field>
</record>
<!-- SEARCH OPPOR -->
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
<field name="name">usability.crm.lead.opportunity.search</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="arch" type="xml">
<filter context="{'group_by':'team_id'}" position="after">
<filter name="customer_groupby" string="Customer" context="{'group_by': 'partner_id'}"/>
</filter>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
from . import crm_lead

View File

@@ -0,0 +1,13 @@
# Copyright 2017-2021 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
from odoo import fields, models
class CrmLead(models.Model):
_inherit = 'crm.lead'
probability = fields.Float(tracking=100)
date_deadline = fields.Date(tracking=110)
name = fields.Char(tracking=1)

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="crm_lead_multi_company_rule" model="ir.rule">
<field name="name">CRM Lead multi-company</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
</odoo>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017-2021 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- SEARCH OPPOR -->
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
<field name="name">usability.crm.lead.opportunity.search</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="arch" type="xml">
<filter name="saleschannel" position="after">
<filter name="partner_groupby" string="Customer" context="{'group_by': 'partner_id'}"/>
</filter>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,27 @@
# Copyright 2021 Akretion France (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
{
'name': 'Sales Teams Usability',
'version': '14.0.1.0.0',
'category': 'Sales/Sales',
'license': 'AGPL-3',
'summary': 'Sales Teams usability enhancements',
'description': """
Sales Teams Usability
=====================
The usability improvements include:
* set 'name' field of crm.tag un-translatable
This module has been written by Alexis de Lattre from Akretion
<alexis.delattre@akretion.com>.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['sales_team'],
'data': [],
'installable': True,
}

View File

@@ -0,0 +1 @@
from . import crm_tag

View File

@@ -0,0 +1,11 @@
# Copyright 2021 Akretion France (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
from odoo import fields, models
class CrmTag(models.Model):
_inherit = "crm.tag"
name = fields.Char(translate=False)