[MIG] account_multicompany_code: Migration to 19.0 T#96270#1726
Open
isaako34 wants to merge 13 commits intoVauxoo:19.0from
Open
[MIG] account_multicompany_code: Migration to 19.0 T#96270#1726isaako34 wants to merge 13 commits intoVauxoo:19.0from
isaako34 wants to merge 13 commits intoVauxoo:19.0from
Conversation
… their accounting records belong. (Vauxoo#1288)
This removes: - Hencoding headers, fixing lint `utf8-coding-comment` - Headers like `# Part of Odoo` - And other ones
The following is performed: - Remove api.multi - Fix indentation on data files - Add translations - Add tests
The following is performed: - Adapt tests - Update translation terms
- Fix black, isort and prettier lints - Fix pylints in res_company model (use Python 3 style super() without arguments)
- Split the models in individual files - Add the code field to tree and kanban view - Define a setUpClass method for tests - Set a SQL constraint "code_unique" for efficiency - Rename file: company_view -> res_company_views.xml
Removing the use of the `@class` in the view, since is deprecated and is giving warnings.
Test account and journal are created in tests, so tests may run even if no chart of account is installed yet.
- Adapt the use of name_get as part of [1]. [1] odoo/odoo#122085
The following actions are performed: - Adapt account display name computation for company_ids multi-company field. - Update tests to use Command.link() for many2many field assignment and add the group group_account_readonly to test user. - Fix XML xpath expressions for 18.0 compatibility.
ea04002 to
707087a
Compare
Contributor
Author
|
@luisg123v Could you review please? |
luisg123v
requested changes
Mar 23, 2026
| def _compute_display_name(self): | ||
| res = super()._compute_display_name() | ||
| for account in self.filtered(lambda a: a.company_ids): | ||
| codes = ", ".join(account.company_ids.mapped("code")) |
Contributor
There was a problem hiding this comment.
I don't think this is a good idea. If there are 10 companies using the same account (possible if all use the mexican CoA), the displayed name would be too big.
I think we need to discuss this to decide if it's worth it keeping this behavior, as it was conceived for an one-company-per-account setup.
|
|
||
| cls.company = cls.env.ref("base.main_company") | ||
| cls.company.code = "TEST-CODE" | ||
| cls.env.user.group_ids += cls.env.ref("account.group_account_readonly") |
| <field name="inherit_id" ref="base.view_res_company_kanban" /> | ||
| <field name="arch" type="xml"> | ||
| <xpath expr="//kanban/field[@name='name']" position="after"> | ||
| <field name="code" /> |
Contributor
There was a problem hiding this comment.
Commit message says v18.
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 17.0+e\n" |
Contributor
There was a problem hiding this comment.
Missing regenerating translations.
| @api.depends("company_ids.code") | ||
| def _compute_display_name(self): | ||
| res = super()._compute_display_name() | ||
| for account in self.filtered(lambda a: a.company_ids): |
Contributor
There was a problem hiding this comment.
I think you should keep the previous filter but just renaming company_id → company_ids
| <field name="inherit_id" ref="base.view_company_form" /> | ||
| <field name="arch" type="xml"> | ||
| <xpath expr="//field[@name='partner_id']" position="before"> | ||
| <field name="code" required="1" /> |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.