diff --git a/partner_employee_amount/README.rst b/partner_employee_amount/README.rst index 51ffa3ece..8b344ed7c 100644 --- a/partner_employee_amount/README.rst +++ b/partner_employee_amount/README.rst @@ -1,13 +1,72 @@ -Employees in CRM -================ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 -This module allows to set employees amount and employees ranges for companies -in the CRM main objects (lead, opportunity, partner), and propagate them through -the workflow. +=========================== +Employee amount in partners +=========================== + +This module allows to set employee amount for partners, and categorize them by +ranges. + +Configuration +============= + +To manage available ranges, you need to: + +* Go to *Sales > Configuration > Address Book > Ranges by amount of employees*. + +Usage +===== + +To use this module, you need to: + +* Go to any partner's form. +* Enable *Is company?*. +* Go to *Sales & Purchases > Employee amount*. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/134/8.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. Credits ======= +Images +------ + +* `Antiun Ingeniería S.L. `_: Icon. + Contributors ------------ + * Antonio Espinosa +* Rafael Blasco +* Jairo Llopis + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_employee_amount/__init__.py b/partner_employee_amount/__init__.py index 054c8853d..8e6d7e45a 100644 --- a/partner_employee_amount/__init__.py +++ b/partner_employee_amount/__init__.py @@ -1,6 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa +# © 2015 Antiun Ingeniería S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/partner_employee_amount/__openerp__.py b/partner_employee_amount/__openerp__.py index fe43bfcce..1c3ef7dbc 100644 --- a/partner_employee_amount/__openerp__.py +++ b/partner_employee_amount/__openerp__.py @@ -1,39 +1,22 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Odoo Source Management Solution -# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) -# Antonio Espinosa -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa +# © 2015 Antiun Ingeniería S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - 'name': 'Employees in CRM', - 'version': '1.0', + 'name': 'Employee amount in partners', + 'summary': 'Know how many employees a partner has', + 'version': '8.0.1.0.0', 'category': 'Customer Relationship Management', 'author': 'Antiun Ingeniería S.L.', 'website': 'http://www.antiun.com', 'depends': [ - 'crm', + 'base', ], 'data': [ - 'views/crm_employees_range_view.xml', - 'views/crm_lead_view.xml', - 'views/res_partner_view.xml', 'security/ir.model.access.csv', + 'views/res_partner_employee_amount_range_view.xml', + 'views/res_partner_view.xml', ], "installable": True, } diff --git a/partner_employee_amount/i18n/crm_employees.pot b/partner_employee_amount/i18n/crm_employees.pot deleted file mode 100644 index eaed68cf0..000000000 --- a/partner_employee_amount/i18n/crm_employees.pot +++ /dev/null @@ -1,90 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * crm_employees -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-27 08:57+0000\n" -"PO-Revision-Date: 2015-05-27 08:57+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: crm_employees -#: field:crm.employees_range,create_uid:0 -msgid "Created by" -msgstr "" - -#. module: crm_employees -#: field:crm.employees_range,create_date:0 -msgid "Created on" -msgstr "" - -#. module: crm_employees -#: view:res.partner:crm_employees.view_res_partner_filter_employees -msgid "Emplooyees" -msgstr "" - -#. module: crm_employees -#: field:crm.lead,employees_number:0 -#: field:res.partner,employees_number:0 -msgid "Employees number" -msgstr "" - -#. module: crm_employees -#: view:crm.lead:crm_employees.crm_case_form_view_leads_employees -#: view:crm.lead:crm_employees.crm_case_form_view_oppor_employees -#: field:crm.lead,employees_range:0 -#: model:ir.model,name:crm_employees.model_crm_employees_range -#: view:res.partner:crm_employees.view_partner_form_employees -#: field:res.partner,employees_range:0 -msgid "Employees range" -msgstr "" - -#. module: crm_employees -#: view:crm.employees_range:crm_employees.crm_employees_range_tree_view -#: model:ir.actions.act_window,name:crm_employees.crm_employees_range_action -#: model:ir.ui.menu,name:crm_employees.menu_crm_employees_range -msgid "Employees ranges" -msgstr "" - -#. module: crm_employees -#: field:crm.employees_range,id:0 -msgid "ID" -msgstr "" - -#. module: crm_employees -#: field:crm.employees_range,write_uid:0 -msgid "Last Updated by" -msgstr "" - -#. module: crm_employees -#: field:crm.employees_range,write_date:0 -msgid "Last Updated on" -msgstr "" - -#. module: crm_employees -#: model:ir.model,name:crm_employees.model_crm_lead -msgid "Lead/Opportunity" -msgstr "" - -#. module: crm_employees -#: field:crm.employees_range,name:0 -msgid "Name" -msgstr "" - -#. module: crm_employees -#: model:ir.model,name:crm_employees.model_res_partner -msgid "Partner" -msgstr "" - -#. module: crm_employees -#: view:res.partner:crm_employees.view_res_partner_filter_employees -msgid "Salesperson" -msgstr "" - diff --git a/partner_employee_amount/models/__init__.py b/partner_employee_amount/models/__init__.py index 60471a1ff..44ab9476e 100644 --- a/partner_employee_amount/models/__init__.py +++ b/partner_employee_amount/models/__init__.py @@ -1,8 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa +# © 2015 Antiun Ingeniería S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import crm_employees_range -from . import crm_lead from . import res_partner diff --git a/partner_employee_amount/models/crm_employees_range.py b/partner_employee_amount/models/crm_employees_range.py deleted file mode 100644 index 0703e83b0..000000000 --- a/partner_employee_amount/models/crm_employees_range.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## -from openerp import models, fields - - -class CrmEmployeesRange(models.Model): - _name = 'crm.employees_range' - _description = "Employees range" - - name = fields.Char(required=True, translate=True) diff --git a/partner_employee_amount/models/crm_lead.py b/partner_employee_amount/models/crm_lead.py deleted file mode 100644 index 60e9f7fce..000000000 --- a/partner_employee_amount/models/crm_lead.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## -from openerp import models, fields - - -class CrmLead(models.Model): - _inherit = 'crm.lead' - - employees_range = fields.Many2one(comodel_name='crm.employees_range') - employees_number = fields.Integer() - - def _lead_create_contact(self, cr, uid, lead, name, is_company, - parent_id=False, context=None): - """Propagate employees_range and employees_number to created partner. - """ - partner_id = super(CrmLead, self)._lead_create_contact( - cr, uid, lead, name, is_company, parent_id=parent_id, - context=context) - self.pool['res.partner'].write( - cr, uid, partner_id, { - 'employees_range': lead.employees_range.id, - 'employees_number': lead.employees_number - }, context=context) - return partner_id diff --git a/partner_employee_amount/models/res_partner.py b/partner_employee_amount/models/res_partner.py index 53b3f5e24..ff79d6586 100644 --- a/partner_employee_amount/models/res_partner.py +++ b/partner_employee_amount/models/res_partner.py @@ -1,12 +1,25 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa +# © 2015 Antiun Ingeniería S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from openerp import models, fields class ResPartner(models.Model): _inherit = 'res.partner' - employees_range = fields.Many2one(comodel_name='crm.employees_range') - employees_number = fields.Integer() + employee_amount = fields.Integer( + oldname="employees_number") + employee_amount_range_id = fields.Many2one( + "res.partner.employee_amount_range", + "Employee amount range", + help="Range of this partner depending on the employee amount.", + oldname="employees_range") + + +class ResPartnerEmployeeAmountRange(models.Model): + _name = "res.partner.employee_amount_range" + _description = "Partner employee amount range" + + name = fields.Char(required=True, translate=True) diff --git a/partner_employee_amount/security/ir.model.access.csv b/partner_employee_amount/security/ir.model.access.csv index 01adc1025..883a0d119 100644 --- a/partner_employee_amount/security/ir.model.access.csv +++ b/partner_employee_amount/security/ir.model.access.csv @@ -1,5 +1,5 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_crm_employees_public","crm_employees_range group_public","model_crm_employees_range","base.group_public",1,0,0,0 -"access_crm_employees_portal","crm_employees_range group_portal","model_crm_employees_range","base.group_portal",1,0,0,0 -"access_crm_employees_group_partner_manager","crm_employees_range group_partner_manager","model_crm_employees_range","base.group_partner_manager",1,1,1,1 -"access_crm_employees_group_user","crm_employees_range group_user","model_crm_employees_range","base.group_user",1,0,0,0 +"access_res_partner_employee_amount_range_public","res_partner_employee_amount_range group_public","model_res_partner_employee_amount_range","base.group_public",1,0,0,0 +"access_res_partner_employee_amount_range_portal","res_partner_employee_amount_range group_portal","model_res_partner_employee_amount_range","base.group_portal",1,0,0,0 +"access_res_partner_employee_amount_range_group_partner_manager","res_partner_employee_amount_range group_partner_manager","model_res_partner_employee_amount_range","base.group_partner_manager",1,1,1,1 +"access_res_partner_employee_amount_range_group_user","res_partner_employee_amount_range group_user","model_res_partner_employee_amount_range","base.group_user",1,0,0,0 diff --git a/partner_employee_amount/views/crm_employees_range_view.xml b/partner_employee_amount/views/crm_employees_range_view.xml deleted file mode 100644 index 7deca9816..000000000 --- a/partner_employee_amount/views/crm_employees_range_view.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Employees ranges - crm.employees_range - form - tree - - - - CRM employees_range tree - crm.employees_range - - - - - - - - - - - \ No newline at end of file diff --git a/partner_employee_amount/views/crm_lead_view.xml b/partner_employee_amount/views/crm_lead_view.xml deleted file mode 100644 index 150ad404c..000000000 --- a/partner_employee_amount/views/crm_lead_view.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Add employees field - crm.lead - - - - - - - - - - - Add employees field - crm.lead - - - - - - - - - - - \ No newline at end of file diff --git a/partner_employee_amount/views/res_partner_employee_amount_range_view.xml b/partner_employee_amount/views/res_partner_employee_amount_range_view.xml new file mode 100644 index 000000000..03d580af9 --- /dev/null +++ b/partner_employee_amount/views/res_partner_employee_amount_range_view.xml @@ -0,0 +1,27 @@ + + + + + + Ranges by amount of employees + res.partner.employee_amount_range + form + tree + + + + Amount of employees ranges tree + res.partner.employee_amount_range + + + + + + + + + + + diff --git a/partner_employee_amount/views/res_partner_view.xml b/partner_employee_amount/views/res_partner_view.xml index 7d31100a5..133061a2a 100644 --- a/partner_employee_amount/views/res_partner_view.xml +++ b/partner_employee_amount/views/res_partner_view.xml @@ -7,13 +7,14 @@ res.partner - - - - + + + + + + @@ -23,12 +24,12 @@ - + context="{'group_by': 'employee_amount_range_id'}"/> - \ No newline at end of file +