[MIG] Port base_user_role to 10.0 - #684
Conversation
…CA#608) * [ADD] New module 'base_user_role' * [FIX] base_user_role - Review * [FIX] base_user_role - Review s/is_active/is_enabled/ * [FIX] base_user_role - Review s/is_active/is_enabled/ * [IMP] base_user_role - Translations updated (template + FR) * [FIX] base_user_role - Lint
[IMP] base_user_role - Replace '<openerp>' tags by '<odoo>' + Remove useless '<data>' tags + Reindent XML content [FIX] base_user_role - Fix noupdate declaration [REM] base_user_role - Remove old migration script
sebalix
left a comment
There was a problem hiding this comment.
Thank you for the migration! Minor changes to the unit tests about variable names and list comprehensions to remove, but non-blocking. 👍
| self.group_no_one_id = self.imd_model.get_object_reference( | ||
| self.cr, self.uid, 'base', 'group_no_one')[1] | ||
| self.group_user_id = self.env.ref('base.group_user') | ||
| self.group_no_one_id = self.env.ref('base.group_no_one') |
There was a problem hiding this comment.
s/group_user_id/group_user/
s/group_no_one_id/group_no_one/
| self.cr, self.uid, 'base', 'group_sale_manager')[1] | ||
| self.group_multi_currency_id = self.env.ref( | ||
| 'base.group_multi_currency') | ||
| self.group_settings_id = self.env.ref('base.group_system') |
There was a problem hiding this comment.
s/group_settings_id/group_settings/
| self.user_model = self.env['res.users'] | ||
| self.role_model = self.env['res.users.role'] | ||
|
|
||
| self.user_id = self.user_model.create( |
| role1_group_ids = role1.implied_ids.ids | ||
| role1_group_ids.append(role1.group_id.id) | ||
| user_group_ids = sorted(set( | ||
| [group.id for group in self.user_id.groups_id])) |
There was a problem hiding this comment.
user_group_ids = sorted(set(self.user.groups_id.ids))| 'name': u"ROLE_1", | ||
| 'implied_ids': [6, 0, [self.group_user_id, self.group_no_one_id]], | ||
| 'implied_ids': [6, 0, [self.group_user_id.id, | ||
| self.group_no_one_id.id]], |
There was a problem hiding this comment.
[self.group_user.id, self.group_no_one.id]| self.group_no_one_id.id]], | ||
| } | ||
| self.role1_id = self.role_model.create(self.cr, self.uid, vals) | ||
| self.role1_id = self.role_model.create(vals) |
| self.group_settings_id.id]], | ||
| } | ||
| self.role2_id = self.role_model.create(self.cr, self.uid, vals) | ||
| self.role2_id = self.role_model.create(vals) |
| self.user_id.write( | ||
| {'role_line_ids': [(0, 0, {'role_id': self.role2_id.id})]}) | ||
| user_group_ids = sorted(set( | ||
| [group.id for group in self.user_id.groups_id])) |
There was a problem hiding this comment.
user_group_ids = sorted(set(self.user_id.groups_id.ids))| self.user_id.write( | ||
| {'role_line_ids': [(0, 0, {'role_id': self.role1_id.id})]}) | ||
| user_group_ids = sorted(set( | ||
| [group.id for group in self.user_id.groups_id])) |
There was a problem hiding this comment.
user_group_ids = sorted(set(self.user.groups_id.ids))
jcdrubay
left a comment
There was a problem hiding this comment.
Only 2 small comments. Thanks for the contribution. I hope it can be merged soon. :)
| # OCA Transbot <transbot@odoo-community.org>, 2016 | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 9.0c\n" |
There was a problem hiding this comment.
Seems like it is a wrong version here.
There was a problem hiding this comment.
I'm fairly certain this won't be an issue. Something something, automation is amazing
| <field name="name">res.users.role.form</field> | ||
| <field name="model">res.users.role</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Role" version="7.0"> |
There was a problem hiding this comment.
It should be time to remove the version="7.0"
lasley
left a comment
There was a problem hiding this comment.
Thanks @adrienpeiffer
Can you please remove the version as noted by @jcdrubay & squash the commits? Good for merge after those tiny details 👍
| # OCA Transbot <transbot@odoo-community.org>, 2016 | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 9.0c\n" |
There was a problem hiding this comment.
I'm fairly certain this won't be an issue. Something something, automation is amazing
5c5282d to
27bc2c5
Compare
|
@adrienpeiffer - Dang, looks like the last round of edits made CI 🔴 - https://travis-ci.org/OCA/server-tools/jobs/200071164#L720 |
|
It should be better now 💚 |
|
Ready to be merged ? |
|
GO 😃 |
3eb409e to
d2a6e8e
Compare
Syncing from upstream OCA/server-tools (8.0)
No description provided.