Skip to content

Commit

Permalink
added fields
Browse files Browse the repository at this point in the history
  • Loading branch information
zoro2002 committed Aug 21, 2023
1 parent c49e51e commit f6f6c59
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion partner_tag_smart_assignation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "AGPL-3",
"website": "https://github.com/OCA/partner-contact",
"depends": ["base"],
"data": ["cron/update_cron.xml", "views/smart_tagger_view.xml"],
"data": ["cron/update_cron.xml", "views/smart_tagger_view.xml", "views/res_partner_category_view_extension.xml"],
"installable": True,
"auto_install": False,
}
2 changes: 2 additions & 0 deletions partner_tag_smart_assignation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import res_partner_category
from . import res_partner_category_extension

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import fields, models


class ResPartnerCategoryExtension(models.Model):
_inherit = "res.partner.category"

author_of_the_tag = fields.Char(string="Author")
department_that_uses_the_tag = fields.Char(string="Department")
description_of_the_tag = fields.Text(string="Description")
is_unlimited_tag = fields.Boolean(string="Unlimited")
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<odoo>
<record id="view_partner_category_form_inherit" model="ir.ui.view">
<field name="name">res.partner.category.form.inherited</field>
<field name="model">res.partner.category</field>
<field name="inherit_id" ref="base.view_partner_category_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='smart']" position="after">
<field name="author_of_the_tag"/>
<field name="department_that_uses_the_tag"/>
<field name="description_of_the_tag"/>
<field name="is_unlimited_tag"/>
</xpath>
</field>
</record>

<record id="view_partner_category_list_inherit" model="ir.ui.view">
<field name="name">res.partner.category.list.inherited</field>
<field name="model">res.partner.category</field>
<field name="inherit_id" ref="base.view_partner_category_list"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='smart']" position="after">
<field name="author_of_the_tag"/>
<field name="department_that_uses_the_tag"/>
<field name="description_of_the_tag"/>
<field name="is_unlimited_tag"/>
</xpath>
</field>
</record>
</odoo>

0 comments on commit f6f6c59

Please sign in to comment.