-
-
Notifications
You must be signed in to change notification settings - Fork 820
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by sebastienbeau
- Loading branch information
Showing
9 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.. 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/11.0 | ||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/partner-contact/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 <https://odoo-community.org/logo.png>`_. | ||
|
||
|
||
Contributors | ||
------------ | ||
|
||
* Simone Orsi <simone.orsi@camptocamp.com> | ||
|
||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2017 Camptocamp | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
'name': 'Partner Contact Role', | ||
'summary': """Add roles to partners.""", | ||
'version': '11.0.1.0.0', | ||
'license': 'AGPL-3', | ||
'author': 'Camptocamp,Odoo Community Association (OCA)', | ||
'website': 'https://github.com/OCA/partner-contact', | ||
'depends': [ | ||
'contacts', | ||
], | ||
'data': [ | ||
'security/ir.model.access.csv', | ||
'views/res_partner_role.xml', | ||
'views/res_partner.xml', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2017 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_res_partner_role_public,res_partner_role group_public,model_res_partner_role,base.group_public,1,0,0,0 | ||
access_res_partner_role_portal,res_partner_role group_portal,model_res_partner_role,base.group_portal,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 | ||
access_res_partner_role_group_user,res_partner_role group_user,model_res_partner_role,base.group_user,1,0,0,0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2017 Camptocamp | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<odoo> | ||
|
||
<record model="ir.ui.view" id="view_partner_form_role"> | ||
<field name="name">Partner form with roles</field> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_partner_form"/> | ||
<field name="arch" type="xml"> | ||
<field name="function" position="after"> | ||
<field name="role_ids" widget="many2many_tags" attrs="{'invisible': [('is_company','=', True)]}" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2017 Camptocamp | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<odoo> | ||
|
||
<record model="ir.ui.view" id="res_partner_role_form_view"> | ||
<field name="name">res.partner.role.form</field> | ||
<field name="model">res.partner.role</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<group name="main"> | ||
<field name="name"/> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.actions.act_window" id="res_partner_role_act_window"> | ||
<field name="name">Partner Role</field> | ||
<field name="res_model">res.partner.role</field> | ||
<field name="view_mode">tree,form</field> | ||
<field name="domain">[]</field> | ||
<field name="context">{}</field> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="res_partner_role_menu"> | ||
<field name="name">Partner Roles</field> | ||
<field name="parent_id" ref="contacts.res_partner_menu_config"/> | ||
<field name="action" ref="res_partner_role_act_window"/> | ||
<field name="sequence" eval="16"/> | ||
</record> | ||
|
||
</odoo> |