[19.0][MIG] base_user_role_company: Migration to 19.0#445
[19.0][MIG] base_user_role_company: Migration to 19.0#445clement-gouin wants to merge 29 commits into
Conversation
f32d3af to
c0b2709
Compare
|
I'm looking at coverage on codecov and I will try to add more tests to meet the requirements |
| def web_load_menus(self, lang=None): | ||
| # v19 signature: (lang=None). Keep behavior of disabling menu HTTP cache. | ||
| response = super().web_load_menus(lang=lang) |
There was a problem hiding this comment.
better to use args / kwargs syntax, to make the code more resilient in the futur.
don't you think ?
There was a problem hiding this comment.
Sure thing, I've updated the PR with args/kwargs on every super() call
9718772 to
a4aff05
Compare
|
Added more tests and less edits from base code |
3e564da to
0250393
Compare
|
Can I get any update on this subject ? I've tested this branch on a real 19.0 production database and it works the same as 18.0 |
| (0, 0, {"role_id": self.roleA.id}), | ||
| (0, 0, {"role_id": self.roleB.id, "company_id": self.company1.id}), | ||
| (0, 0, {"role_id": self.roleC.id, "company_id": self.company1.id}), | ||
| (0, 0, {"role_id": self.roleC.id, "company_id": self.company2.id}), |
There was a problem hiding this comment.
I think this syntax is more readable...
from odoo import Command
| (0, 0, {"role_id": self.roleA.id}), | |
| (0, 0, {"role_id": self.roleB.id, "company_id": self.company1.id}), | |
| (0, 0, {"role_id": self.roleC.id, "company_id": self.company1.id}), | |
| (0, 0, {"role_id": self.roleC.id, "company_id": self.company2.id}), | |
| Command.create({"role_id": self.roleA.id}), | |
| Command.create({"role_id": self.roleB.id, "company_id": self.company1.id}), | |
| Command.create({"role_id": self.roleC.id, "company_id": self.company1.id}), | |
| Command.create({"role_id": self.roleC.id, "company_id": self.company2.id}), |
There was a problem hiding this comment.
I'v updated the tests in the last commit
| "company_ids": [(6, 0, [self.company1.id, self.company2.id])], | ||
| "role_line_ids": [ | ||
| (0, 0, {"role_id": self.roleA.id, "company_id": self.company3.id}), |
There was a problem hiding this comment.
| "company_ids": [(6, 0, [self.company1.id, self.company2.id])], | |
| "role_line_ids": [ | |
| (0, 0, {"role_id": self.roleA.id, "company_id": self.company3.id}), | |
| "company_ids": [Command.set([self.company1.id, self.company2.id])], | |
| "role_line_ids": [ | |
| Command.create({"role_id": self.roleA.id, "company_id": self.company3.id}), |
There was a problem hiding this comment.
I'v updated the tests in the last commit
| "company_ids": [(fields.Command.set([cls.company1.id]))], | ||
| "role_line_ids": [ | ||
| (fields.Command.create({"role_id": cls.roleA.id})), | ||
| ( | ||
| fields.Command.create( | ||
| { | ||
| "role_id": cls.roleB.id, | ||
| "date_to": fields.Date.today() + timedelta(days=1), | ||
| } | ||
| ) | ||
| ), | ||
| ], |
There was a problem hiding this comment.
from odoo import Command
| "company_ids": [(fields.Command.set([cls.company1.id]))], | |
| "role_line_ids": [ | |
| (fields.Command.create({"role_id": cls.roleA.id})), | |
| ( | |
| fields.Command.create( | |
| { | |
| "role_id": cls.roleB.id, | |
| "date_to": fields.Date.today() + timedelta(days=1), | |
| } | |
| ) | |
| ), | |
| ], | |
| "company_ids": [(Command.set([cls.company1.id]))], | |
| "role_line_ids": [ | |
| (Command.create({"role_id": cls.roleA.id})), | |
| ( | |
| Command.create( | |
| { | |
| "role_id": cls.roleB.id, | |
| "date_to": fields.Date.today() + timedelta(days=1), | |
| } | |
| ) | |
| ), | |
| ], |
There was a problem hiding this comment.
I'v updated the tests in the last commit
0250393 to
c4b52ef
Compare
c4b52ef to
19c3920
Compare
|
Hi, I've just:
|
|
@clement-gouin there is still more to squash, as already mentioned. (oca-travis, OCA-git-bot, oca-transbot, ...) |
Currently translated at 100.0% (11 of 11 strings) Translation: server-backend-14.0/server-backend-14.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-14-0/server-backend-14-0-base_user_role_company/it/
Issue found on logout / relogin. The user groups were applied correctly, but the main menu showed apps the user did not have access to. This was related to the menu caching mechanisn, that was disabled here.
Currently translated at 90.9% (10 of 11 strings) Translation: server-backend-14.0/server-backend-14.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-14-0/server-backend-14-0-base_user_role_company/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-backend-16.0/server-backend-16.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_role_company/
Currently translated at 100.0% (8 of 8 strings) Translation: server-backend-16.0/server-backend-16.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_role_company/es/
Currently translated at 100.0% (8 of 8 strings) Translation: server-backend-16.0/server-backend-16.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_role_company/pt/
Currently translated at 100.0% (8 of 8 strings) Translation: server-backend-16.0/server-backend-16.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_role_company/es/
Currently translated at 100.0% (8 of 8 strings) Translation: server-backend-16.0/server-backend-16.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-base_user_role_company/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-backend-18.0/server-backend-18.0-base_user_role_company Translate-URL: https://translation.odoo-community.org/projects/server-backend-18-0/server-backend-18-0-base_user_role_company/
… date_to are used
the _company module is an extra module used in a multi company context (and only in some situation). It is totally useless in mono company. As 2 modules exists, it doesn't makes sense to make the second auto_installable
19c3920 to
216db4d
Compare
My bad, I thought the contributor of #383 was already following the guidelines, I didn't check prior to my edits. This is now done as indicated in the documentation. |





NOTE: UPDATED COPY OF STALE #383
(there were no updates since 15th of october 2025)
Scope
Summary
(differences from original):
Pre-commit
Tests
results: