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][FIX] project_timeline: Fix demo task dates #1259

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

houzefa-abba
Copy link
Member

This commit fixes inconsistent dates we get when building a demo DB.

This module adds a date_start field; this is the one we want to fill in demo data.
We do not want to fill date_assign, which is an automatic field.

This is how this module used to work in v12 (was based on date_start).

  • v12➔v13 MIG: Odoo removed the base date_start field so date_start was changed to date_assign in this module.
  • v13➔v14 MIG: date_start was added back into this module to restore v12 behavior. However, demo data then got left untouched.

Related to OCA/web#2774

Before

# select id, name, date_start, date_end, date_assign from project_task order by id;
 id |                 name                  |     date_start      |      date_end       |     date_assign     
----+---------------------------------------+---------------------+---------------------+---------------------
  1 | Office planning                       |                     | 2024-05-08 00:00:00 | 2024-05-03 00:00:00
  2 | Lunch Room: kitchen                   | 2024-04-03 09:39:21 | 2024-04-04 00:00:00 | 2024-04-02 00:00:00
  3 | Noise Reduction                       | 2024-04-03 09:39:21 | 2024-04-04 00:00:00 | 2024-04-01 00:00:00
  4 | Modifications asked by the customer   |                     | 2024-05-05 00:00:00 | 2024-05-03 00:00:00
  5 | Energy Certificate                    | 2024-04-03 09:39:21 | 2024-03-31 00:00:00 | 2024-03-28 00:00:00
  6 | Room 1: Decoration                    | 2024-04-03 09:39:21 | 2024-04-01 00:00:00 | 2024-03-25 00:00:00
  7 | Room 2: Decoration                    | 2024-04-03 09:39:22 | 2024-04-01 00:00:00 | 2024-03-27 00:00:00
  8 | Black Chairs for managers             | 2024-04-03 09:39:22 | 2024-03-28 00:00:00 | 2024-03-24 00:00:00
  9 | Meeting Room Furnitures               | 2024-04-03 09:39:22 | 2024-03-28 00:00:00 | 2024-03-21 00:00:00
 10 | Customer review                       |                     |                     | 
 11 | Daily stand-up meeting - Send minutes |                     |                     | 
 12 | Customer Meeting                      |                     |                     | 
 13 | Daily Meetings summary                |                     |                     | 
 14 | Preparation                           |                     |                     | 
 15 | Minutes                               |                     |                     | 
 16 | Customer analysis + Architecture      | 2024-04-03 09:39:22 | 2024-04-25 00:00:00 | 2024-04-23 00:00:00
 17 | Basic outline                         | 2024-04-03 09:39:22 | 2024-04-13 00:00:00 | 2024-04-04 00:00:00
 18 | Planning and budget                   | 2024-04-03 09:39:22 | 2024-04-23 00:00:00 | 2024-04-04 00:00:00
 19 | User interface improvements           | 2024-04-03 09:39:22 | 2024-04-26 00:00:00 | 2024-04-16 00:00:00
 20 | Social network integration            | 2024-04-03 09:39:22 | 2024-04-26 00:00:00 | 2024-04-16 00:00:00
 21 | Create new components                 |                     | 2024-04-18 00:00:00 | 2024-04-14 00:00:00
 22 | New portal system                     | 2024-04-03 09:39:22 | 2024-04-13 00:00:00 | 2024-04-02 00:00:00
 23 | Usability review                      | 2024-04-03 09:39:22 | 2024-04-23 00:00:00 | 2024-04-15 00:00:00
 24 | Document management                   | 2024-04-03 09:39:23 | 2024-04-09 00:00:00 | 2024-04-02 00:00:00
 25 | Unit Testing                          |                     | 2024-05-23 00:00:00 | 2024-04-23 00:00:00
 26 | Code Documentation                    | 2024-04-03 09:39:23 | 2024-04-03 09:39:23 | 2024-04-03 09:39:23
 27 | Entry Hall                            | 2024-04-03 09:39:23 | 2024-04-03 09:39:23 | 2024-04-03 09:39:23
 28 | Check Lift                            | 2024-04-03 09:39:23 | 2024-04-03 09:39:23 | 2024-04-03 09:39:23
 29 | Room 1: Paint                         | 2024-04-03 09:39:23 | 2024-04-03 09:39:23 | 2024-04-03 09:39:23
 30 | Bathroom                              | 2024-04-03 09:39:23 | 2024-04-03 09:39:23 | 2024-04-03 09:39:23
 31 | Room 2: Paint                         | 2024-04-03 09:39:23 | 2024-04-03 09:39:23 | 2024-04-03 09:39:23
 32 | Buy a gift for Marc Demo's birthday   | 2024-04-03 09:39:23 |                     | 2024-04-03 09:39:23
 33 | Change left screen cable              | 2024-04-03 09:39:23 |                     | 2024-04-03 09:39:23
 34 | Clean kitchen fridge                  | 2024-04-03 09:39:23 |                     | 2024-04-03 09:39:23
 35 | Check employees lunch accounts        | 2024-04-03 09:39:23 |                     | 2024-04-03 09:39:23
(35 rows)

After

# select id, name, date_start, date_end, date_assign from project_task order by id;
 id |                 name                  |     date_start      |      date_end       |     date_assign     
----+---------------------------------------+---------------------+---------------------+---------------------
  1 | Office planning                       | 2024-05-03 00:00:00 | 2024-05-08 00:00:00 | 
  2 | Lunch Room: kitchen                   | 2024-04-02 00:00:00 | 2024-04-04 00:00:00 | 2024-04-03 13:09:25
  3 | Noise Reduction                       | 2024-04-01 00:00:00 | 2024-04-04 00:00:00 | 2024-04-03 13:09:25
  4 | Modifications asked by the customer   | 2024-05-03 00:00:00 | 2024-05-05 00:00:00 | 
  5 | Energy Certificate                    | 2024-03-28 00:00:00 | 2024-03-31 00:00:00 | 2024-04-03 13:09:25
  6 | Room 1: Decoration                    | 2024-03-25 00:00:00 | 2024-04-01 00:00:00 | 2024-04-03 13:09:25
  7 | Room 2: Decoration                    | 2024-03-27 00:00:00 | 2024-04-01 00:00:00 | 2024-04-03 13:09:25
  8 | Black Chairs for managers             | 2024-03-24 00:00:00 | 2024-03-28 00:00:00 | 2024-04-03 13:09:25
  9 | Meeting Room Furnitures               | 2024-03-21 00:00:00 | 2024-03-28 00:00:00 | 2024-04-03 13:09:25
 10 | Customer review                       |                     |                     | 
 11 | Daily stand-up meeting - Send minutes |                     |                     | 
 12 | Customer Meeting                      |                     |                     | 
 13 | Daily Meetings summary                |                     |                     | 
 14 | Preparation                           |                     |                     | 
 15 | Minutes                               |                     |                     | 
 16 | Customer analysis + Architecture      | 2024-04-23 00:00:00 | 2024-04-25 00:00:00 | 2024-04-03 13:09:26
 17 | Basic outline                         | 2024-04-04 00:00:00 | 2024-04-13 00:00:00 | 2024-04-03 13:09:26
 18 | Planning and budget                   | 2024-04-04 00:00:00 | 2024-04-23 00:00:00 | 2024-04-03 13:09:26
 19 | User interface improvements           | 2024-04-16 00:00:00 | 2024-04-26 00:00:00 | 2024-04-03 13:09:26
 20 | Social network integration            | 2024-04-16 00:00:00 | 2024-04-26 00:00:00 | 2024-04-03 13:09:26
 21 | Create new components                 | 2024-04-14 00:00:00 | 2024-04-18 00:00:00 | 
 22 | New portal system                     | 2024-04-02 00:00:00 | 2024-04-13 00:00:00 | 2024-04-03 13:09:26
 23 | Usability review                      | 2024-04-15 00:00:00 | 2024-04-23 00:00:00 | 2024-04-03 13:09:26
 24 | Document management                   | 2024-04-02 00:00:00 | 2024-04-09 00:00:00 | 2024-04-03 13:09:26
 25 | Unit Testing                          | 2024-04-23 00:00:00 | 2024-05-23 00:00:00 | 
 26 | Code Documentation                    | 2024-04-03 13:09:26 | 2024-04-03 13:09:26 | 2024-04-03 13:09:26
 27 | Entry Hall                            | 2024-04-03 13:09:26 | 2024-04-03 13:09:26 | 2024-04-03 13:09:26
 28 | Check Lift                            | 2024-04-03 13:09:26 | 2024-04-03 13:09:26 | 2024-04-03 13:09:26
 29 | Room 1: Paint                         | 2024-04-03 13:09:27 | 2024-04-03 13:09:27 | 2024-04-03 13:09:27
 30 | Bathroom                              | 2024-04-03 13:09:27 | 2024-04-03 13:09:27 | 2024-04-03 13:09:27
 31 | Room 2: Paint                         | 2024-04-03 13:09:27 | 2024-04-03 13:09:27 | 2024-04-03 13:09:27
 32 | Buy a gift for Marc Demo's birthday   | 2024-04-03 13:09:27 |                     | 2024-04-03 13:09:27
 33 | Change left screen cable              | 2024-04-04 22:00:00 | 2024-04-04 22:00:00 | 2024-04-03 13:09:27
 34 | Clean kitchen fridge                  | 2024-04-03 13:09:27 |                     | 2024-04-03 13:09:27
 35 | Check employees lunch accounts        | 2024-04-03 13:09:27 |                     | 2024-04-03 13:09:27
(35 rows)

This commit fixes inconsistent dates we get when building a demo DB.

This module adds a `date_start` field; this is the one we want to fill
in demo data.
We do not want to fill `date_assign`, which is an automatic field.

This is how this module used to work in v12 (was based on `date_start`).
* v12➔v13 MIG: Odoo removed the base `date_start` field so `date_start` was
  changed to `date_assign` in this module.
* v13➔v14 MIG: `date_start` was added back into this module to restore
  v12 behavior. However, demo data then got left untouched.
@pedrobaeza pedrobaeza requested a review from dreispt April 3, 2024 13:52
@pedrobaeza
Copy link
Member

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-1259-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 5f156e6 into OCA:16.0 Apr 3, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at d7f0851. Thanks a lot for contributing to OCA. ❤️

@houzefa-abba houzefa-abba deleted the 16.0-timeline-dates branch April 3, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants