Browse Source

[add] partner_contact_role

pull/486/merge
Simone Orsi 7 years ago
committed by Jairo Llopis
parent
commit
75c45e8408
  1. 68
      partner_contact_role/README.rst
  2. 1
      partner_contact_role/__init__.py
  3. 20
      partner_contact_role/__manifest__.py
  4. 1
      partner_contact_role/models/__init__.py
  5. 22
      partner_contact_role/models/res_partner.py
  6. 3
      partner_contact_role/security/ir.model.access.csv
  7. BIN
      partner_contact_role/static/description/icon.png
  8. 18
      partner_contact_role/views/res_partner.xml
  9. 46
      partner_contact_role/views/res_partner_role.xml
  10. 1
      setup/partner_contact_role/odoo/__init__.py
  11. 1
      setup/partner_contact_role/odoo/addons/__init__.py
  12. 1
      setup/partner_contact_role/odoo/addons/partner_contact_role
  13. 6
      setup/partner_contact_role/setup.py

68
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
<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://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
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
partner_contact_role/__init__.py

@ -0,0 +1 @@
from . import models

20
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',
],
}

1
partner_contact_role/models/__init__.py

@ -0,0 +1 @@
from . import res_partner

22
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()

3
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

BIN
partner_contact_role/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

18
partner_contact_role/views/res_partner.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 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>

46
partner_contact_role/views/res_partner_role.xml

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 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.ui.view" id="res_partner_role_tree_view">
<field name="name">res.partner.role.tree</field>
<field name="model">res.partner.role</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
</tree>
</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,tree</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="sales_team.menu_config_address_book"/>
<field name="action" ref="res_partner_role_act_window"/>
<field name="sequence" eval="16"/>
</record>
</odoo>

1
setup/partner_contact_role/odoo/__init__.py

@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)

1
setup/partner_contact_role/odoo/addons/__init__.py

@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)

1
setup/partner_contact_role/odoo/addons/partner_contact_role

@ -0,0 +1 @@
../../../../partner_contact_role

6
setup/partner_contact_role/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading…
Cancel
Save