-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[MIG] 9.0 - Migrate 'base_user_role' #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
lasley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sebalix
base_user_role/data/ir_cron.xml
Outdated
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright 2016 ABF OSIELL <http://osiell.com> | ||
| License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
| <odoo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odoo noupdate="1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| @@ -0,0 +1,25 @@ | |||
| # -*- coding: utf-8 -*- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Past version migration can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| <field name="inherit_id" ref="base.view_users_form"/> | ||
| <field name="arch" type="xml"> | ||
| <notebook position="inside"> | ||
| <page string="Roles"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you think about putting the Roles as first page in the notebook, ie before the standards groups page. As admins using this module will almost never look at the detailed groups, it's probably better to show roles first.
| line_ids = fields.One2many( | ||
| 'res.users.role.line', 'role_id', string=u"Users") | ||
| user_ids = fields.One2many( | ||
| 'res.users', string=u"Users", compute='_compute_user_ids') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since roles are groups too, it would be nice to put them in their own category so they are more easily distinguished from regular groups in the groups configuration page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly how we do when declaring our roles as XML records, it could be done by default by associating them to a 'User roles' category indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbidoul Done
sbidoul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebalix excellent module! I made a couple of ergonomy suggestions but as this is a migration PR, 👍
| group_category_id = fields.Many2one( | ||
| related='group_id.category_id', | ||
| default=lambda cls: cls.env.ref( | ||
| 'base_user_role.ir_module_category_role').id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for adding this. Would it work too with a simple override category_id = fields.Many2one(default=...)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not work without the related part. About the field's name, I don't know what is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so weird to me... anyway it works fine, thanks!
|
2 thumbs up and 5 days, ready to merge I think ;) I'll start the migration to v10 soon. |
|
Can you please squash your fixes in the review process commits? |
[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
12ce852 to
167d999
Compare
|
@pedrobaeza Done, I kept the commits from @sbidoul and the last one related to the default module category as they are new features which could be backported on the 8.0 version. |
|
Thanks for the comprehensive squashing! I'll merge when CIs finish. |
Syncing from upstream OCA/server-tools (10.0)
@lasley here it is