diff --git a/partner_employee_quantity/README.rst b/partner_employee_quantity/README.rst new file mode 100644 index 000000000..ca6964326 --- /dev/null +++ b/partner_employee_quantity/README.rst @@ -0,0 +1,72 @@ +.. 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 + +============================= +Employee quantity in partners +============================= + +This module allows to set employee quantity for partners, and categorize them +by ranges. + +Configuration +============= + +To manage available ranges, you need to: + +* Go to *Sales > Configuration > Address Book > Ranges by quantity of employees*. + +Usage +===== + +To use this module, you need to: + +* Go to any partner's form. +* Enable *Is company?*. +* You will see a new group of fields called *Employee quantity*. + +.. 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_quantity/__init__.py b/partner_employee_quantity/__init__.py new file mode 100644 index 000000000..8e6d7e45a --- /dev/null +++ b/partner_employee_quantity/__init__.py @@ -0,0 +1,6 @@ +# -*- 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_quantity/__openerp__.py b/partner_employee_quantity/__openerp__.py new file mode 100644 index 000000000..0d3c0ab64 --- /dev/null +++ b/partner_employee_quantity/__openerp__.py @@ -0,0 +1,24 @@ +# -*- 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': 'Employee quantity 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., Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + 'website': 'http://www.antiun.com', + 'depends': [ + 'base', + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_partner_employee_quantity_range_view.xml', + 'views/res_partner_view.xml', + ], + "installable": True, +} diff --git a/partner_employee_quantity/i18n/es.po b/partner_employee_quantity/i18n/es.po new file mode 100644 index 000000000..d3c891ec8 --- /dev/null +++ b/partner_employee_quantity/i18n/es.po @@ -0,0 +1,91 @@ +# 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-12-21 16:02+0100\n" +"PO-Revision-Date: 2015-12-21 16:03+0100\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.8.5\n" + +#. module: partner_employee_quantity +#: field:res.partner.employee_quantity_range,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: partner_employee_quantity +#: field:res.partner.employee_quantity_range,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: partner_employee_quantity +#: view:res.partner:partner_employee_quantity.view_partner_form_employees +#: field:res.partner,employee_quantity:0 +msgid "Employee quantity" +msgstr "Cantidad de empleados" + +#. module: partner_employee_quantity +#: field:res.partner,employee_quantity_range_id:0 +msgid "Employee quantity range" +msgstr "Rango de la cantidad de empleados" + +#. module: partner_employee_quantity +#: view:res.partner:partner_employee_quantity.view_res_partner_filter_employees +msgid "Employees" +msgstr "Empleados" + +#. module: partner_employee_quantity +#: field:res.partner.employee_quantity_range,id:0 +msgid "ID" +msgstr "ID" + +#. module: partner_employee_quantity +#: field:res.partner.employee_quantity_range,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: partner_employee_quantity +#: field:res.partner.employee_quantity_range,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: partner_employee_quantity +#: field:res.partner.employee_quantity_range,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: partner_employee_quantity +#: model:ir.model,name:partner_employee_quantity.model_res_partner +msgid "Partner" +msgstr "Empresa" + +#. module: partner_employee_quantity +#: model:ir.model,name:partner_employee_quantity.model_res_partner_employee_quantity_range +msgid "Partner employee quantity range" +msgstr "Rango de la cantidad de empleados de la empresa" + +#. module: partner_employee_quantity +#: help:res.partner,employee_quantity_range_id:0 +msgid "Range of this partner depending on the employee quantity." +msgstr "Rango de esta empresa dependiendo de su cantidad de empleados." + +#. module: partner_employee_quantity +#: model:ir.actions.act_window,name:partner_employee_quantity.employees_range_action +#: model:ir.ui.menu,name:partner_employee_quantity.menu_employees_range +#: view:res.partner.employee_quantity_range:partner_employee_quantity.employees_range_tree_view +msgid "Ranges by quantity of employees" +msgstr "Rangos por cantidad de empleados" + +#. module: partner_employee_quantity +#: view:res.partner:partner_employee_quantity.view_res_partner_filter_employees +msgid "Salesperson" +msgstr "Comercial" diff --git a/partner_employee_quantity/models/__init__.py b/partner_employee_quantity/models/__init__.py new file mode 100644 index 000000000..44ab9476e --- /dev/null +++ b/partner_employee_quantity/models/__init__.py @@ -0,0 +1,6 @@ +# -*- 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 res_partner diff --git a/partner_employee_quantity/models/res_partner.py b/partner_employee_quantity/models/res_partner.py new file mode 100644 index 000000000..0bff10d55 --- /dev/null +++ b/partner_employee_quantity/models/res_partner.py @@ -0,0 +1,25 @@ +# -*- 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' + + employee_quantity = fields.Integer( + oldname="employees_number") + employee_quantity_range_id = fields.Many2one( + "res.partner.employee_quantity_range", + "Employee quantity range", + help="Range of this partner depending on the employee quantity.", + oldname="employees_range") + + +class ResPartnerEmployeeQuantityRange(models.Model): + _name = "res.partner.employee_quantity_range" + _description = "Partner employee quantity range" + + name = fields.Char(required=True, translate=True) diff --git a/partner_employee_quantity/security/ir.model.access.csv b/partner_employee_quantity/security/ir.model.access.csv new file mode 100644 index 000000000..ad0aaf6bf --- /dev/null +++ b/partner_employee_quantity/security/ir.model.access.csv @@ -0,0 +1,5 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_res_partner_employee_quantity_range_public","res_partner_employee_quantity_range group_public","model_res_partner_employee_quantity_range","base.group_public",1,0,0,0 +"access_res_partner_employee_quantity_range_portal","res_partner_employee_quantity_range group_portal","model_res_partner_employee_quantity_range","base.group_portal",1,0,0,0 +"access_res_partner_employee_quantity_range_group_partner_manager","res_partner_employee_quantity_range group_partner_manager","model_res_partner_employee_quantity_range","base.group_partner_manager",1,1,1,1 +"access_res_partner_employee_quantity_range_group_user","res_partner_employee_quantity_range group_user","model_res_partner_employee_quantity_range","base.group_user",1,0,0,0 diff --git a/partner_employee_quantity/static/description/icon.png b/partner_employee_quantity/static/description/icon.png new file mode 100644 index 000000000..64933c90c Binary files /dev/null and b/partner_employee_quantity/static/description/icon.png differ diff --git a/partner_employee_quantity/views/res_partner_employee_quantity_range_view.xml b/partner_employee_quantity/views/res_partner_employee_quantity_range_view.xml new file mode 100644 index 000000000..429640911 --- /dev/null +++ b/partner_employee_quantity/views/res_partner_employee_quantity_range_view.xml @@ -0,0 +1,27 @@ + + + + + + Ranges by quantity of employees + res.partner.employee_quantity_range + form + tree + + + + Quantity of employees ranges tree + res.partner.employee_quantity_range + + + + + + + + + + + diff --git a/partner_employee_quantity/views/res_partner_view.xml b/partner_employee_quantity/views/res_partner_view.xml new file mode 100644 index 000000000..ad2c60461 --- /dev/null +++ b/partner_employee_quantity/views/res_partner_view.xml @@ -0,0 +1,35 @@ + + + + + + Partner form with employees + res.partner + + + + + + + + + + + + + Partner search with employees + res.partner + + + + + + + + + +