Browse Source
Merge pull request #732 from patrickrwilson/partner_priority
[ADD] partner_priority module
pull/737/head
Ronald Portier
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with
202 additions and
0 deletions
-
partner_priority/README.rst
-
partner_priority/__init__.py
-
partner_priority/__manifest__.py
-
partner_priority/data/partner_priority_data.xml
-
partner_priority/data/partner_priority_sequence_data.xml
-
partner_priority/models/__init__.py
-
partner_priority/models/partner_priority.py
-
partner_priority/models/res_partner.py
-
partner_priority/readme/CONTRIBUTORS.rst
-
partner_priority/readme/DESCRIPTION.rst
-
partner_priority/readme/USAGE.rst
-
partner_priority/security/ir.model.access.csv
-
BIN
partner_priority/static/description/icon.png
-
partner_priority/views/partner_priority.xml
-
partner_priority/views/res_partner.xml
|
|
@ -0,0 +1,25 @@ |
|
|
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
|
|
|
:target: https://www.gnu.org/licenses/agpl |
|
|
|
:alt: License: AGPL-3 |
|
|
|
|
|
|
|
================ |
|
|
|
Partner Priority |
|
|
|
================ |
|
|
|
|
|
|
|
This module adds priority on partners. Priorities can be used to rank partners or as a way to mark the sensitivity level of a customer. |
|
|
|
|
|
|
|
Usage |
|
|
|
===== |
|
|
|
|
|
|
|
To use this module, you need to: |
|
|
|
|
|
|
|
#. Configure via CONTACT -> CONFIGURATION -> PRIORITIES. |
|
|
|
#. Set the priority level on the partner form. |
|
|
|
|
|
|
|
Credits |
|
|
|
======= |
|
|
|
|
|
|
|
Contributors |
|
|
|
------------ |
|
|
|
|
|
|
|
* Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
@ -0,0 +1,3 @@ |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
from . import models |
|
|
@ -0,0 +1,24 @@ |
|
|
|
# Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
{ |
|
|
|
'name': 'Partner Priority', |
|
|
|
'summary': "Adds priority to partners.", |
|
|
|
'author': "Patrick Wilson, Odoo Community Association (OCA)", |
|
|
|
'website': "https://github.com/OCA/partner-contact", |
|
|
|
'category': 'Customer Relationship Management', |
|
|
|
'version': '12.0.1.0.0', |
|
|
|
'license': 'AGPL-3', |
|
|
|
'depends': [ |
|
|
|
'contacts', |
|
|
|
], |
|
|
|
'data': [ |
|
|
|
'views/res_partner.xml', |
|
|
|
'views/partner_priority.xml', |
|
|
|
'security/ir.model.access.csv', |
|
|
|
'data/partner_priority_data.xml', |
|
|
|
'data/partner_priority_sequence_data.xml', |
|
|
|
], |
|
|
|
'development_status': 'Beta', |
|
|
|
'maintainers': ['patrickrwilson'], |
|
|
|
} |
|
|
@ -0,0 +1,25 @@ |
|
|
|
<!-- Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|
|
|
|
|
|
|
<odoo noupdate="1"> |
|
|
|
<record id="res_partner_priority_low" model="partner.priority"> |
|
|
|
<field name="name">Low</field> |
|
|
|
<field name="description">Low Priority</field> |
|
|
|
<field name="sequence">1</field> |
|
|
|
</record> |
|
|
|
<record id="res_partner_priority_normal" model="partner.priority"> |
|
|
|
<field name="name">Normal</field> |
|
|
|
<field name="description">Normal Priority</field> |
|
|
|
<field name="sequence">3</field> |
|
|
|
</record> |
|
|
|
<record id="res_partner_priority_elavated" model="partner.priority"> |
|
|
|
<field name="name">Elevated</field> |
|
|
|
<field name="description">Elevated Priority</field> |
|
|
|
<field name="sequence">5</field> |
|
|
|
</record> |
|
|
|
<record id="res_partner_priority_critical" model="partner.priority"> |
|
|
|
<field name="name">Critical</field> |
|
|
|
<field name="description">Critical Priority</field> |
|
|
|
<field name="sequence">8</field> |
|
|
|
</record> |
|
|
|
</odoo> |
|
|
@ -0,0 +1,11 @@ |
|
|
|
<!-- Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|
|
|
|
|
|
|
<odoo noupdate="1"> |
|
|
|
<record id="partner_priority_seq" model="ir.sequence"> |
|
|
|
<field name="name">Priority Sequence</field> |
|
|
|
<field name="code">partner.priority</field> |
|
|
|
<field name="prefix">0</field> |
|
|
|
<field name="padding">1</field> |
|
|
|
</record> |
|
|
|
</odoo> |
|
|
@ -0,0 +1,4 @@ |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
from . import partner_priority |
|
|
|
from . import res_partner |
|
|
@ -0,0 +1,15 @@ |
|
|
|
# Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
from odoo import models, fields |
|
|
|
|
|
|
|
|
|
|
|
class PartnerPriority(models.Model): |
|
|
|
_name = 'partner.priority' |
|
|
|
_order = 'sequence' |
|
|
|
_description = 'Partner Priority' |
|
|
|
|
|
|
|
name = fields.Char(string="Priority", required=True) |
|
|
|
description = fields.Text(required=True) |
|
|
|
sequence = fields.Integer(required=True, default=lambda self: self.env[ |
|
|
|
'ir.sequence'].next_by_code('res.partner.priority') or 0) |
|
|
@ -0,0 +1,10 @@ |
|
|
|
# Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
from odoo import models, fields |
|
|
|
|
|
|
|
|
|
|
|
class ResPartner(models.Model): |
|
|
|
_inherit = 'res.partner' |
|
|
|
|
|
|
|
priority_id = fields.Many2one('partner.priority') |
|
|
@ -0,0 +1 @@ |
|
|
|
* Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
@ -0,0 +1 @@ |
|
|
|
This module adds priority on partners. Priorities can be used to rank partners or as a way to mark the sensitivity level of a customer. |
|
|
@ -0,0 +1,4 @@ |
|
|
|
To use this module, you need to: |
|
|
|
|
|
|
|
#. Configure via CONTACT -> CONFIGURATION -> PRIORITIES. |
|
|
|
#. Set the priority level on the partner form. |
|
|
@ -0,0 +1,3 @@ |
|
|
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|
|
|
access_partner_priority_user,partner.priority.user,model_partner_priority,base.group_user,1,0,0,0, |
|
|
|
access_partner_priority_manager,partner.priority.manager,model_partner_priority,base.group_partner_manager,1,1,1,1, |
Width: 128
|
Height: 128
|
Size: 9.2 KiB
|
|
|
@ -0,0 +1,47 @@ |
|
|
|
<!-- Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|
|
|
|
|
|
|
<odoo> |
|
|
|
<record id="partner_priority_view_list" model="ir.ui.view"> |
|
|
|
<field name="name">Priority List</field> |
|
|
|
<field name="model">partner.priority</field> |
|
|
|
<field name="arch" type="xml"> |
|
|
|
<tree string="Priority"> |
|
|
|
<field name="sequence" widget="handle"/> |
|
|
|
<field name="name"/> |
|
|
|
<field name="description"/> |
|
|
|
</tree> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="partner_priority_view_form" model="ir.ui.view"> |
|
|
|
<field name="name">Priority Form</field> |
|
|
|
<field name="model">partner.priority</field> |
|
|
|
<field name="arch" type="xml"> |
|
|
|
<form string="Priority"> |
|
|
|
<sheet> |
|
|
|
<div class="oe_title"> |
|
|
|
<label for="name" class="oe_edit_only" string="Name" /> |
|
|
|
<h1><field name="name" /></h1> |
|
|
|
</div> |
|
|
|
<group> |
|
|
|
<field name="description"/> |
|
|
|
</group> |
|
|
|
</sheet> |
|
|
|
</form> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="partner_priority_action" model="ir.actions.act_window"> |
|
|
|
<field name="name">Priority Action</field> |
|
|
|
<field name="res_model">partner.priority</field> |
|
|
|
<field name="view_mode">tree,form</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<menuitem |
|
|
|
name="Priorities" |
|
|
|
id="res_partner_priority_menu" |
|
|
|
parent="contacts.res_partner_menu_config" |
|
|
|
action="partner_priority_action" |
|
|
|
sequence="101"/> |
|
|
|
</odoo> |
|
|
@ -0,0 +1,29 @@ |
|
|
|
<!-- Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com> |
|
|
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|
|
|
|
|
|
|
<odoo> |
|
|
|
<record id="view_partner_form" model="ir.ui.view"> |
|
|
|
<field name="name">partner.priority.form</field> |
|
|
|
<field name="model">res.partner</field> |
|
|
|
<field name="inherit_id" ref="base.view_partner_form"/> |
|
|
|
<field name="arch" type="xml"> |
|
|
|
<field name="category_id" position="after"> |
|
|
|
<field name="priority_id" |
|
|
|
options="{'no_create': True, 'no_open': True}"/> |
|
|
|
</field> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="view_res_partner_filter" model="ir.ui.view"> |
|
|
|
<field name="name">partner.priority.filter</field> |
|
|
|
<field name="model">res.partner</field> |
|
|
|
<field name="inherit_id" ref="base.view_res_partner_filter"/> |
|
|
|
<field name="arch" type="xml"> |
|
|
|
<filter name="group_country" position="after"> |
|
|
|
<filter name="group_priority" |
|
|
|
string="Priority" |
|
|
|
context="{'group_by': 'priority_id'}"/> |
|
|
|
</filter> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
</odoo> |