modifying a virtual event will reload an bogus event in form
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Web (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP R&D Web Team |
Bug Description
Repeated on last runbot on trunk:
http://
1- Go to Messaging / Calendar.
2- click on a day
3- in the dialog box, create a recurring event the 1st of the month: Repeat every 1 days, Number of repetition:3
4- switch views to List mode
5- select the third event (which occurs the 3rd of the month)
6- modify it's name, then save modification
I'm expecting that:
- the name should change accordingly to my modification, but the current screen shows that my modification were not applied.
Note that:
- the modification was made in the database.
- if you try to re-modify the title when in this last form, it'll repeat the same issue, and create a new event.
What's happening:
- the 3rd event is a virtual event. It has a "virtual id" that is made with the ID of the root event from which the reccurent event was created thanks to the recurrency rule (rrule). There are no such record in the database, thus they are called virtual id.
- This virtual event was modified, and ``base_calendar`` overwrites the ``.write()`` method accordingly to
1- remove this virtual event from the reccurence rule by adding a exception date. (exdate)
2- create a real new record with a normal ID from the virtual ones with the updates the user submitted.
- The web interface in ``form_view.js`` is told to reload the current view once a modification occured. It reloads the current view which is pointing on the "virtual id". Thus it ask to ``.read(...)`` the current model.
- The ``base_calendar`` module overwrite also the ``.read(...)`` model make virtual records on the fly. The rule to make them does not check the recurrency rules at all, and will only copy the root event's data and change the date (thanks to the virtual id itself which is made up with the date of the event.)..
- So form_view receives a event that cannot be generated anymore by any real event (according to their rrule and exdate). And which will be totally the same as the root event except it's date.