-
-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Add partner_title_for_company: extend title to companies
- Loading branch information
Showing
10 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2024 INVITU (<https://www.invitu.com>) | ||
|
||
{ | ||
"name": "Partner title for companies", | ||
"summary": "Add titles for companies", | ||
"version": "17.0.1.1.0", | ||
"author": "INVITU, " "Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"maintainer": "INVITU", | ||
"category": "Extra Tools", | ||
"website": "https://github.com/OCA/partner-contact", | ||
"depends": ["base"], | ||
"post_init_hook": "", | ||
"data": [ | ||
"views/res_partner_views.xml", | ||
], | ||
"auto_install": False, | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class PartnerTitle(models.Model): | ||
_inherit = "res.partner.title" | ||
|
||
for_company = fields.Boolean( | ||
string="For companies", help="Check if the title is meant for companies" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Cyril VINH-TUNG \<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module was written to extend the functionality of titles to | ||
companies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The field *for_company* in Partner Titles allows to add titles for companies |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<odoo> | ||
<record id="view_partner_title_for_company_tree" model="ir.ui.view"> | ||
<field name="name">view.partner.title.for.company.tree</field> | ||
<field name="model">res.partner.title</field> | ||
<field name="inherit_id" ref="base.view_partner_title_tree" /> | ||
<field name="priority" eval="8" /> | ||
<field name="arch" type="xml"> | ||
<field name="shortcut" position="after"> | ||
<field name="for_company" widget="boolean_toggle" /> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="view_partner_title_for_company_form" model="ir.ui.view"> | ||
<field name="name">view.partner.title.for.company.form</field> | ||
<field name="model">res.partner.title</field> | ||
<field name="inherit_id" ref="base.view_partner_title_form" /> | ||
<field name="priority" eval="8" /> | ||
<field name="arch" type="xml"> | ||
<field name="shortcut" position="after"> | ||
<field name="for_company" /> | ||
</field> | ||
</field> | ||
</record> | ||
<record id="view_partner_for_company_form" model="ir.ui.view"> | ||
<field name="name">view.partner.for.company.form</field> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_partner_form" /> | ||
<field name="priority" eval="8" /> | ||
<field name="arch" type="xml"> | ||
<field name="title" position="attributes"> | ||
<attribute name="invisible" /> | ||
<attribute name="domain"> | ||
[('for_company', '=', is_company)] | ||
</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |