-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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][IMP] web_timeline: Handle inverted date ranges #2774
Conversation
Hi @tarteo, |
I don't get the concept of "inverted date". |
Sorry I wasn't clear enough; this is when end date is before start date (in my example, March 21st ➔ March 19th). Makes no sense, but at least with this change they won't be completely hidden. |
af0d8ac
to
a3f95ac
Compare
I think that should be forbidden by a constraint (SQL or Python). |
3999bd5
to
22856c0
Compare
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.
But the constraint in project_timeline
should be added IMO.
Yes constraint and demo data, because demo data produces these "reversed dates" I'll look into it soon |
Done with OCA/project#1259 & OCA/project#1260 |
22856c0
to
aad5574
Compare
Inverted dates make no functional sense, but when they do happen, this change allows displaying them as single points in the timeline (same as when begin=end). We currently do have such demo data when installing project_timeline.
aad5574
to
b69410f
Compare
@houzefa-abba @pedrobaeza Is this PR still needed? The other PRs related to the TT50999 |
Hi @carlos-lopez-tecnativa this PR may still help the odd case where someone has data with start-date after end-date We prevent it in the project part thanks to OCA/project#1260 but web_timeline may be applied in other places and who knows, it may help someone? :) |
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.
I agree with @pedrobaeza and believe that it would be more effective to implement constraints that ensure data integrity at the source, preventing such scenarios from occurring in the first place. This is outside the scope of this module and must be controlled on each side. On the other hand, for fixed visual issues, it looks good to me. Thanks @houzefa-abba .
/ocabot merge patch |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 935b007. Thanks a lot for contributing to OCA. ❤️ |
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.
Yes this makes sense, thanks. The constaint should be indeed done on model level, this way it shows events where end is before start date.
Inverted dates make no functional sense, but when they do happen, this change allows displaying them as single points in the timeline (same as when begin=end).
We currently do have such demo data when installing project_timeline:
Before: office design tasks are missing
After: office design tasks are shown