diff --git a/partner_contact_role/README.rst b/partner_contact_role/README.rst new file mode 100644 index 000000000..54e63a9c0 --- /dev/null +++ b/partner_contact_role/README.rst @@ -0,0 +1,68 @@ +.. 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 + +==================== +Partner Contact Role +==================== + +This module extends the functionality of partners to add roles. +Each partner can have a job position / function but can be assigned +to several roles / responsibilities for his/her duty. + +Configuration +============= + +To configure roles, you need to: + +* Go to *Sales > Configuration > Address Book > Partner Roles*. + +Usage +===== + +To use this module, you need to: + +* Go to any partner's form. +* Use the new *Roles* field. + +.. 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/10.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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Simone Orsi + + +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_role/__init__.py b/partner_contact_role/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/partner_contact_role/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/partner_contact_role/__manifest__.py b/partner_contact_role/__manifest__.py new file mode 100644 index 000000000..40e545654 --- /dev/null +++ b/partner_contact_role/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Partner Contact Role', + 'summary': """Add roles to partners.""", + 'version': '10.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Camptocamp,Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/partner-contact', + 'depends': [ + 'sales_team', + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_partner_role.xml', + 'views/res_partner.xml', + ], +} diff --git a/partner_contact_role/models/__init__.py b/partner_contact_role/models/__init__.py new file mode 100644 index 000000000..91fed54d4 --- /dev/null +++ b/partner_contact_role/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/partner_contact_role/models/res_partner.py b/partner_contact_role/models/res_partner.py new file mode 100644 index 000000000..0b966d4ce --- /dev/null +++ b/partner_contact_role/models/res_partner.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + role_ids = fields.Many2many( + string='Roles', + comodel_name='res.partner.role', + ) + + +class ResPartnerRole(models.Model): + + _name = 'res.partner.role' + _description = 'Partner Role' + + name = fields.Char() diff --git a/partner_contact_role/security/ir.model.access.csv b/partner_contact_role/security/ir.model.access.csv new file mode 100644 index 000000000..e1172df43 --- /dev/null +++ b/partner_contact_role/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_res_partner_role_group_all,res_partner_role group_all,model_res_partner_role,,1,0,0,0 +access_res_partner_role_group_partner_manager,res_partner_role group_partner_manager,model_res_partner_role,base.group_partner_manager,1,1,1,1 diff --git a/partner_contact_role/static/description/icon.png b/partner_contact_role/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/partner_contact_role/static/description/icon.png differ diff --git a/partner_contact_role/views/res_partner.xml b/partner_contact_role/views/res_partner.xml new file mode 100644 index 000000000..a2e3781cc --- /dev/null +++ b/partner_contact_role/views/res_partner.xml @@ -0,0 +1,18 @@ + + + + + + + Partner form with roles + res.partner + + + + + + + + + diff --git a/partner_contact_role/views/res_partner_role.xml b/partner_contact_role/views/res_partner_role.xml new file mode 100644 index 000000000..c004400b0 --- /dev/null +++ b/partner_contact_role/views/res_partner_role.xml @@ -0,0 +1,46 @@ + + + + + + + res.partner.role.form + res.partner.role + +
+ + + + + +
+
+
+ + + res.partner.role.tree + res.partner.role + + + + + + + + + Partner Role + res.partner.role + tree,tree + [] + {} + + + + Partner Roles + + + + + +
diff --git a/setup/partner_contact_role/odoo/__init__.py b/setup/partner_contact_role/odoo/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/partner_contact_role/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/partner_contact_role/odoo/addons/__init__.py b/setup/partner_contact_role/odoo/addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/partner_contact_role/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/partner_contact_role/odoo/addons/partner_contact_role b/setup/partner_contact_role/odoo/addons/partner_contact_role new file mode 120000 index 000000000..2f949e743 --- /dev/null +++ b/setup/partner_contact_role/odoo/addons/partner_contact_role @@ -0,0 +1 @@ +../../../../partner_contact_role \ No newline at end of file diff --git a/setup/partner_contact_role/setup.py b/setup/partner_contact_role/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/partner_contact_role/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)