Skip to content

Commit

Permalink
[MIG] res_company_code: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeliconiaSolutions committed Dec 30, 2024
1 parent 6749efc commit d11047b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions res_company_code/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Contributors
- Sylvain LE GAL <https://twitter.com/legalsylvain>
- Kiril Vangelovski <[email protected]>
- Kevin Khao <[email protected]>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion res_company_code/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Company Code",
"summary": "Add 'code' field on company model",
"version": "16.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Tools",
"author": "GRAP, Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"],
Expand Down
3 changes: 1 addition & 2 deletions res_company_code/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ def session_info(self):
display_switch_company_menu = (
user.has_group("base.group_multi_company") and len(user.company_ids) > 1
)

# 1. Replace company name by company complete name in the session
# The values are used in the switch_company_menu widget (web module)
# 2. Recompute sequence. (as the widget hard-codes the order by sequence). See :
# https://github.com/odoo/odoo/blob/fbd6a3bc10a3302e7061eb46eb246221e461e76d/addons/web/static/src/webclient/switch_company_menu/switch_company_menu.xml#L10 # noqa: B950
# https://github.com/odoo/odoo/blob/fbd6a3bc10a3302e7061eb46eb246221e461e76d/addons/web/static/src/webclient/switch_company_menu/switch_company_menu.xml#L10 # noqa: E501
if display_switch_company_menu:
for sequence, company in enumerate(user.company_ids):
result["user_companies"]["allowed_companies"].get(company.id).update(
Expand Down
2 changes: 1 addition & 1 deletion res_company_code/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def name_search(self, name, args=None, operator="ilike", limit=100):
if name:
domain = ["|", ("code", operator, name), ("name", operator, name)]
company = self.search(domain + args, limit=limit)
return company.name_get()
return [(record.id, record.display_name) for record in company]
1 change: 1 addition & 0 deletions res_company_code/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Sylvain LE GAL \<<https://twitter.com/legalsylvain>\>
- Kiril Vangelovski \<<[email protected]>\>
- Kevin Khao \<<[email protected]>\>
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
1 change: 1 addition & 0 deletions res_company_code/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<li>Sylvain LE GAL &lt;<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>&gt;</li>
<li>Kiril Vangelovski &lt;<a class="reference external" href="mailto:kiril&#64;lambda-is.com">kiril&#64;lambda-is.com</a>&gt;</li>
<li>Kevin Khao &lt;<a class="reference external" href="mailto:kevin.khao&#64;akretion.com">kevin.khao&#64;akretion.com</a>&gt;</li>
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a></li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
4 changes: 2 additions & 2 deletions res_company_code/views/view_res_company.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<field name="inherit_id" ref="base.view_company_tree" />
<field name="arch" type="xml">
<field name="sequence" position="attributes">
<attribute name="invisible">1</attribute>
<attribute name="column_invisible">1</attribute>
<!-- In odoo V16, if a field has a widget='handle'
it change the order of the display of the tree view...
We so remove the widget value -->
<attribute name="widget" eval="False" />
<attribute name="widget" />
</field>
<field name="name" position="attributes">
<attribute name="invisible">1</attribute>
Expand Down

0 comments on commit d11047b

Please sign in to comment.