newtratip
5 years ago
7 changed files with 50 additions and 48 deletions
-
34partner_priority/__manifest__.py
-
1partner_priority/data/partner_priority_data.xml
-
1partner_priority/data/partner_priority_sequence_data.xml
-
17partner_priority/models/partner_priority.py
-
6partner_priority/models/res_partner.py
-
19partner_priority/views/partner_priority.xml
-
20partner_priority/views/res_partner.xml
@ -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, |
|||
) |
@ -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") |
@ -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> |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue