Skip to content
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

Open
wants to merge 17 commits into
base: 16.0
Choose a base branch
from

Conversation

anusriNPS
Copy link

MIgrating helpdesk_mgmt_fieldservice to 16.0 version

@anusriNPS anusriNPS marked this pull request as draft July 22, 2024 08:36
marcelsavegnago and others added 16 commits July 22, 2024 10:46
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/
@anusriNPS anusriNPS force-pushed the 16.0-mig-helpdesk_mgmt_fieldservice branch 5 times, most recently from d0687ba to c8a33eb Compare July 23, 2024 09:55
@anusriNPS anusriNPS marked this pull request as ready for review July 23, 2024 10:03
<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>

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?

Copy link
Author

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.

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?

Copy link
Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@anusriNPS anusriNPS force-pushed the 16.0-mig-helpdesk_mgmt_fieldservice branch from c8a33eb to 99e9757 Compare July 30, 2024 09:55
Comment on lines 3 to 17
<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>

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?

Copy link
Author

@anusriNPS anusriNPS Aug 12, 2024

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.

@anusriNPS anusriNPS force-pushed the 16.0-mig-helpdesk_mgmt_fieldservice branch from 99e9757 to 6b0d16d Compare August 12, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet