Skip to content

Commit

Permalink
[MIG] account_multicompany_code: Migration to 17.0
Browse files Browse the repository at this point in the history
- Adapt the use of name_get as part of [1].

[1] odoo/odoo#122085
  • Loading branch information
xmglord committed Apr 4, 2024
1 parent 95820ee commit fcba670
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion account_multicompany_code/__manifest__.py
@@ -1,6 +1,6 @@
{
"name": "Account Multicompany Code",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"author": "Vauxoo",
"category": "Accounting/Accounting",
"website": "https://www.vauxoo.com/",
Expand Down
10 changes: 5 additions & 5 deletions account_multicompany_code/models/account_account.py
@@ -1,12 +1,12 @@
from odoo import models
from odoo import api, models


class AccountAccount(models.Model):
_inherit = "account.account"

def name_get(self):
result = dict(super().name_get())
@api.depends("company_id.code")
def _compute_display_name(self):
super()._compute_display_name()
for record in self:
if record.company_id.code:
result[record.id] += " (%s)" % record.company_id.code
return list(result.items())
record.display_name += " (%s)" % record.company_id.code
10 changes: 5 additions & 5 deletions account_multicompany_code/models/account_journal.py
@@ -1,12 +1,12 @@
from odoo import models
from odoo import api, models


class AccountJournal(models.Model):
_inherit = "account.journal"

def name_get(self):
result = dict(super().name_get())
@api.depends("company_id.code")
def _compute_display_name(self):
super()._compute_display_name()
for record in self:
if record.company_id.code:
result[record.id] += " (%s)" % record.company_id.code
return list(result.items())
record.display_name += " (%s)" % record.company_id.code

0 comments on commit fcba670

Please sign in to comment.