OCA / web

Odoo web client UI related addons
GNU Affero General Public License v3.0
912 stars 1.86k forks source link

[16.0][IMP] web_timeline: Handle inverted date ranges #2774

Open houzefa-abba opened 5 months ago

houzefa-abba commented 5 months ago

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: Screenshot at 2024-03-21 12-24-31

Before: office design tasks are missing

Screenshot at 2024-03-21 11-53-24

After: office design tasks are shown

Screenshot at 2024-03-21 11-50-51

OCA-git-bot commented 5 months ago

Hi @tarteo, some modules you are maintaining are being modified, check this out!

pedrobaeza commented 5 months ago

I don't get the concept of "inverted date".

houzefa-abba commented 5 months ago

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.

pedrobaeza commented 5 months ago

I think that should be forbidden by a constraint (SQL or Python).

houzefa-abba commented 5 months ago

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

houzefa-abba commented 5 months ago

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 https://github.com/OCA/project/pull/1259 & https://github.com/OCA/project/pull/1260