Skip to content

Commit

Permalink
Merge PR #524 into 11.0
Browse files Browse the repository at this point in the history
Signed-off-by sebastienbeau
  • Loading branch information
OCA-git-bot committed Sep 30, 2019
2 parents d9f26f6 + 3e4ea4f commit 70a03a4
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 0 deletions.
69 changes: 69 additions & 0 deletions partner_contact_role/README.rst
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.
1 change: 1 addition & 0 deletions partner_contact_role/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions partner_contact_role/__manifest__.py
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',
],
}
1 change: 1 addition & 0 deletions partner_contact_role/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
21 changes: 21 additions & 0 deletions partner_contact_role/models/res_partner.py
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()
5 changes: 5 additions & 0 deletions partner_contact_role/security/ir.model.access.csv
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
Binary file added partner_contact_role/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions partner_contact_role/views/res_partner.xml
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>
36 changes: 36 additions & 0 deletions partner_contact_role/views/res_partner_role.xml
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>

0 comments on commit 70a03a4

Please sign in to comment.