Work on usability of CRM
This commit is contained in:
3
crm_usability/__init__.py
Normal file
3
crm_usability/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import crm
|
||||||
32
crm_usability/__manifest__.py
Normal file
32
crm_usability/__manifest__.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2016 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>
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'CRM Usability',
|
||||||
|
'version': '10.0.1.0.0',
|
||||||
|
'category': 'Customer Relationship Management',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'CRM usability enhancements',
|
||||||
|
'description': """
|
||||||
|
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
|
||||||
|
<alexis.delattre@akretion.com>.
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['crm'],
|
||||||
|
'data': [
|
||||||
|
#'wizard/base_partner_merge_view.xml',
|
||||||
|
'crm_view.xml',
|
||||||
|
],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
29
crm_usability/crm.py
Normal file
29
crm_usability/crm.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# -*- 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
|
||||||
32
crm_usability/crm_view.xml
Normal file
32
crm_usability/crm_view.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?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>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user