[FW][FIX] maintenance: redirect to rawrecord in calendar_with_recurrence
Steps to reproduce the issue:
- In Maintenance > Maintenance > Maintenance Requests, set multiple maintenance requests with scheduled dates
- In Maintenance > Maintenance > Maintenance Calendar, get to a week or month with multiple requests
- Drag and drop one of the requests in the calendar
- You can also double click or resize the request
- In most cases, the request that is changed or accessed is not the right one
Explanation:
rawRecord is the record as retrieved by fetchRecords, it is then processed in loadRecords. In CalendarWithRecurrence, with the option of having recurring events, record.id is nearly always different from rawRecord.id.
https://github.com/odoo/odoo/blob/74a0703671f29fefad02843c0d679f903b812575/addons/maintenance/static/src/views/calendar_with_recurrence/calendar_with_recurrence_model.js#L11-L17
Suggested fix:
Overriding the methods that lead to the wrong model to replace record.id with record.rawRecord.id solves the issue without breaking other methods.
For requests with recurrence, any change made using an occurrence in the calendar view would target the original request instead. Accessing it is not an issue, so we will only disable the edition of the occurrences.
opw-3848278 opw-3849852
Forward-Port-Of: odoo/odoo#165474 Forward-Port-Of: odoo/odoo#162041
This PR targets saas-17.2 and is part of the forward-port chain. Further PRs will be created up to master.
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port
@stpa-odoo @amoyaux ci/runbot failed on this forward-port PR
@stpa-odoo @amoyaux this PR was modified / updated and has become a normal PR. It should be merged the normal way (via @robodoo)
robodoo r+
