-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
[16.0] [MIG] helpdesk_mgmt_fieldservice: Migration to 16.0 #608
base: 16.0
Are you sure you want to change the base?
[16.0] [MIG] helpdesk_mgmt_fieldservice: Migration to 16.0 #608
Conversation
When trying to open a res_partner form with a user who doesn't have permission for read fieldservice data, this view causes an error cause it try to set attributes to a button that doesn't exist. Specifying groups_id fix this, extending the view only if the current user has permissions to see that button.
Currently translated at 100.0% (32 of 32 strings) Translation: helpdesk-12.0/helpdesk-12.0-helpdesk_mgmt_fieldservice Translate-URL: https://translation.odoo-community.org/projects/helpdesk-12-0/helpdesk-12-0-helpdesk_mgmt_fieldservice/fr/
Currently translated at 100.0% (36 of 36 strings) Translation: helpdesk-14.0/helpdesk-14.0-helpdesk_mgmt_fieldservice Translate-URL: https://translation.odoo-community.org/projects/helpdesk-14-0/helpdesk-14-0-helpdesk_mgmt_fieldservice/it/
Currently translated at 100.0% (36 of 36 strings) Translation: helpdesk-14.0/helpdesk-14.0-helpdesk_mgmt_fieldservice Translate-URL: https://translation.odoo-community.org/projects/helpdesk-14-0/helpdesk-14-0-helpdesk_mgmt_fieldservice/es/
Currently translated at 100.0% (36 of 36 strings) Translation: helpdesk-14.0/helpdesk-14.0-helpdesk_mgmt_fieldservice Translate-URL: https://translation.odoo-community.org/projects/helpdesk-14-0/helpdesk-14-0-helpdesk_mgmt_fieldservice/pt_BR/
d0687ba
to
c8a33eb
Compare
<button name="action_view_helpdesk_tickets" position="attributes"> | ||
<attribute | ||
name="context" | ||
>{'default_partner_id': id, 'default_fsm_location_id': service_location_id}</attribute> | ||
groups="fieldservice.group_fsm_user_own" | ||
>{'default_partner_id': id}</attribute> | ||
</button> |
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.
question: these changes are not really clear to me, could you give me some context and explain these?
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.
With migration 16.0 page, this point was mentioned:
I am not able to use groups_id in views instead need to add groups attribute in the field itself. Hence this change was introduced
Any view with groups_id on it now has to move such groups to the elements of the view. But now you can put groups attribute in a view field instead of isolating it on a view without fear of an access error. Check it in odoo/odoo#98551.
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.
Okay, looks great! But why the default location has been 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.
Sorry for delayed response. I shouldn't have removed service_location_id while incorporating "groups" for the button. Hope the latest code looks fine
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.
Perfect, thanks!
c8a33eb
to
99e9757
Compare
<record id="res_partner_form_ticket_context" model="ir.ui.view"> | ||
<field name="name">res.partner.form.ticket.context</field> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_partner_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="service_location_id" invisible="1" /> | ||
<button name="action_view_helpdesk_tickets" position="attributes"> | ||
<attribute name="groups">fieldservice.group_fsm_user_own</attribute> | ||
<attribute | ||
name="context" | ||
>{'default_partner_id': id, 'default_fsm_location_id': service_location_id}</attribute> | ||
</button> | ||
</field> | ||
</record> |
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.
issue: it seems that in 14.0, this customization was made available only for users with the group fieldservice.group_fsm_user_own
, while now you are making the whole button available only for the users with that group.
Could you please check and fix the issue to make the functionality the same as it was before?
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.
Removed groups_id and for accessing service_location_id field which can be accessed only with groups "fieldservice.group_fsm_user_own" is added in the parent view with invisible attribute so that functionality would remain the same.
99e9757
to
6b0d16d
Compare
MIgrating helpdesk_mgmt_fieldservice to 16.0 version