diff --git a/partner_contact_department/README.rst b/partner_contact_department/README.rst new file mode 100644 index 000000000..f15fcdce0 --- /dev/null +++ b/partner_contact_department/README.rst @@ -0,0 +1,75 @@ +.. 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 + +================== +Contact department +================== + +This module extends the functionality of the address book to support +departments. + +Department is a drop-down field in partner forms, and it refers to contact +department in its own company. + +Configuration +============= + +To configure departments, you need to: + +* Go to *Sales > Configuration > Address Book > Departments*. + +Usage +===== + +To use this module, you need to: + +* Go to any partner's form. +* You will find the new *Department* field below *Job Position*. + +.. 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 +------------ + +* Pedro M. Baeza +* 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_contact_department/__init__.py b/partner_contact_department/__init__.py new file mode 100644 index 000000000..9af8488e4 --- /dev/null +++ b/partner_contact_department/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) +# 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_contact_department/__openerp__.py b/partner_contact_department/__openerp__.py new file mode 100644 index 000000000..a5323db87 --- /dev/null +++ b/partner_contact_department/__openerp__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) +# Antonio Espinosa +# © 2015 Antiun Ingeniería S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Contact department', + "summary": "Assign contacts to departments", + 'version': '8.0.1.0.0', + 'category': 'Customer Relationship Management', + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza, ' + 'Antiun Ingeniería S.L., ' + "Odoo Community Association (OCA)", + "license": "AGPL-3", + 'website': 'http://www.antiun.com', + "application": False, + 'depends': [ + 'base', + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_partner_department_view.xml', + 'views/res_partner_view.xml', + ], + "installable": True, +} diff --git a/partner_contact_department/i18n/es.po b/partner_contact_department/i18n/es.po new file mode 100644 index 000000000..e3c3ae378 --- /dev/null +++ b/partner_contact_department/i18n/es.po @@ -0,0 +1,93 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_partner_department +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-21 16:54+0100\n" +"PO-Revision-Date: 2015-12-21 16:55+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_contact_department +#: field:res.partner.department,child_ids:0 +msgid "Child departments" +msgstr "Departamentos hijo" + +#. module: partner_contact_department +#: field:res.partner.department,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: partner_contact_department +#: field:res.partner.department,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: partner_contact_department +#: model:ir.model,name:partner_contact_department.model_res_partner_department +#: view:res.partner:partner_contact_department.view_partner_form_department +#: view:res.partner:partner_contact_department.view_res_partner_filter_department +#: field:res.partner,department_id:0 +msgid "Department" +msgstr "Departamento" + +#. module: partner_contact_department +#: model:ir.actions.act_window,name:partner_contact_department.res_partner_department_action +#: model:ir.ui.menu,name:partner_contact_department.menu_res_partner_department +#: view:res.partner.department:partner_contact_department.res_partner_department_tree_view +msgid "Departments" +msgstr "Departamentos" + +#. module: partner_contact_department +#: field:res.partner.department,id:0 +msgid "ID" +msgstr "ID" + +#. module: partner_contact_department +#: field:res.partner.department,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: partner_contact_department +#: field:res.partner.department,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: partner_contact_department +#: field:res.partner.department,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: partner_contact_department +#: field:res.partner.department,parent_id:0 +msgid "Parent department" +msgstr "Departamento padre" + +#. module: partner_contact_department +#: field:res.partner.department,parent_left:0 +msgid "Parent left" +msgstr "Padre izquierdo" + +#. module: partner_contact_department +#: field:res.partner.department,parent_right:0 +msgid "Parent right" +msgstr "Padre derecho" + +#. module: partner_contact_department +#: model:ir.model,name:partner_contact_department.model_res_partner +msgid "Partner" +msgstr "Empresa" + +#. module: partner_contact_department +#: view:res.partner:partner_contact_department.view_res_partner_filter_department +msgid "Salesperson" +msgstr "Comercial" diff --git a/partner_contact_department/models/__init__.py b/partner_contact_department/models/__init__.py new file mode 100644 index 000000000..213b25fdc --- /dev/null +++ b/partner_contact_department/models/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) +# 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_contact_department/models/res_partner.py b/partner_contact_department/models/res_partner.py new file mode 100644 index 000000000..20e2cfd27 --- /dev/null +++ b/partner_contact_department/models/res_partner.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) +# 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' + + department_id = fields.Many2one( + "res.partner.department", + "Department", + oldname="department") + + +class ResPartnerDepartment(models.Model): + _name = 'res.partner.department' + _order = "parent_left" + _parent_order = "name" + _parent_store = True + _description = "Department" + + name = fields.Char(required=True, translate=True) + parent_id = fields.Many2one( + "res.partner.department", + "Parent department") + child_ids = fields.One2many( + "res.partner.department", + "parent_id", + "Child departments", + oldname="children") + parent_left = fields.Integer(index=True) + parent_right = fields.Integer(index=True) diff --git a/partner_contact_department/security/ir.model.access.csv b/partner_contact_department/security/ir.model.access.csv new file mode 100644 index 000000000..9a73e7a61 --- /dev/null +++ b/partner_contact_department/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_department_public","res_partner_department group_public","model_res_partner_department","base.group_public",1,0,0,0 +"access_res_partner_department_portal","res_partner_department group_portal","model_res_partner_department","base.group_portal",1,0,0,0 +"access_res_partner_department_group_partner_manager","res_partner_department group_partner_manager","model_res_partner_department","base.group_partner_manager",1,1,1,1 +"access_res_partner_department_group_user","res_partner_department group_user","model_res_partner_department","base.group_user",1,0,0,0 diff --git a/partner_contact_department/static/description/icon.png b/partner_contact_department/static/description/icon.png new file mode 100644 index 000000000..add81b17a Binary files /dev/null and b/partner_contact_department/static/description/icon.png differ diff --git a/partner_contact_department/views/res_partner_department_view.xml b/partner_contact_department/views/res_partner_department_view.xml new file mode 100644 index 000000000..f7aae91f9 --- /dev/null +++ b/partner_contact_department/views/res_partner_department_view.xml @@ -0,0 +1,47 @@ + + + + + + + + Departments + res.partner.department + form + tree + + + + CRM department tree + res.partner.department + + + + + + + + + + CRM department form + res.partner.department + +
+ + + + + +
+
+
+ + + +
+
diff --git a/partner_contact_department/views/res_partner_view.xml b/partner_contact_department/views/res_partner_view.xml new file mode 100644 index 000000000..108a2415e --- /dev/null +++ b/partner_contact_department/views/res_partner_view.xml @@ -0,0 +1,49 @@ + + + + + + + + Partner form with department + res.partner + + + + + + + + + + + + + + Partner search with department + res.partner + + + + + + + + + + + + +