Browse Source

[IMP] partner_priority: black, isort

14.0
newtratip 5 years ago
parent
commit
16f2f8abab
  1. 34
      partner_priority/__manifest__.py
  2. 1
      partner_priority/data/partner_priority_data.xml
  3. 1
      partner_priority/data/partner_priority_sequence_data.xml
  4. 17
      partner_priority/models/partner_priority.py
  5. 6
      partner_priority/models/res_partner.py
  6. 19
      partner_priority/views/partner_priority.xml
  7. 20
      partner_priority/views/res_partner.xml

34
partner_priority/__manifest__.py

@ -2,23 +2,21 @@
# 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',
"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": "13.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'],
"development_status": "Beta",
"maintainers": ["patrickrwilson"],
}

1
partner_priority/data/partner_priority_data.xml

@ -1,6 +1,5 @@
<!-- 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>

1
partner_priority/data/partner_priority_sequence_data.xml

@ -1,6 +1,5 @@
<!-- 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>

17
partner_priority/models/partner_priority.py

@ -1,15 +1,20 @@
# Copyright 2019 Patrick Wilson <patrickraymondwilson@gmail.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models, fields
from odoo import fields, models
class PartnerPriority(models.Model):
_name = 'partner.priority'
_order = 'sequence'
_description = 'Partner Priority'
_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)
sequence = fields.Integer(
required=True,
default=lambda self: self.env["ir.sequence"].next_by_code(
"res.partner.priority"
)
or 0,
)

6
partner_priority/models/res_partner.py

@ -1,10 +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
from odoo import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
_inherit = "res.partner"
priority_id = fields.Many2one('partner.priority')
priority_id = fields.Many2one("partner.priority")

19
partner_priority/views/partner_priority.xml

@ -1,19 +1,17 @@
<!-- 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"/>
<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>
@ -22,26 +20,27 @@
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Name" />
<h1><field name="name" /></h1>
<h1>
<field name="name" />
</h1>
</div>
<group>
<field name="description"/>
<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"/>
sequence="101"
/>
</odoo>

20
partner_priority/views/res_partner.xml

@ -1,28 +1,30 @@
<!-- 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="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
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="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
name="group_priority"
string="Priority"
context="{'group_by': 'priority_id'}"
/>
</filter>
</field>
</record>

Loading…
Cancel
Save