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] [MIG] maintenance_plan #339

Merged
merged 109 commits into from
Feb 2, 2024

Conversation

alexeirivera87
Copy link

No description provided.

rendering, qweb_type = self.report_obj._render_qweb_text(
"base_maintenance.report_maintenance_request", generated_request.ids
)
self.assertFalse(rendering.decode("utf-8").find("TEST-INSTRUCTIONS") == -1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REGEX was not working?

@alexeirivera87 alexeirivera87 force-pushed the 16.0-mig-maintenance_plan branch from e84762b to 89a858f Compare June 14, 2023 18:34
Copy link
Contributor

@aleuffre aleuffre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good and seems to work, unsure about the reason for the few changes that were made compared to v15

Comment on lines +26 to +48
<xpath expr="//group[@name='maintenance']/.." position="after">
<field
name="maintenance_plan_ids"
nolabel="1"
context="{'default_equipment_id': active_id, 'hide_equipment_id': 1}"
>
<tree>
<field name="maintenance_kind_id" string="Kind" />
<field name="maintenance_team_id" string="Team" />
<field name="name" />
<field name="start_maintenance_date" string="Start Date" />
<field name="interval" />
<field name="interval_step" />
<field name="duration" />
<field name="next_maintenance_date" />
<field
name="maintenance_plan_horizon"
string="P. Horizon period"
/>
<field name="planning_step" string="P. Horizon step" />
</tree>
</field>
</xpath>
Copy link
Contributor

@aleuffre aleuffre Jun 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why the change from

<xpath expr="//group[@name='maintenance']/" position="after">

<xpath expr="//group[@name='maintenance']/.." position="after">

at the very least I would add a <group string="Maintenance Plans"> around the whole thing, or alternatively remove the nolabel option

@aleuffre
Copy link
Contributor

Also there was an existing proposed migration #324 , make sure to check if someone has done the work already, or explicitly point out that you're superseeding the previous PR, please!

@mamcode
Copy link
Member

mamcode commented Jul 1, 2023

Also there was an existing proposed migration #324 , make sure to check if someone has done the work already, or explicitly point out that you're superseeding the previous PR, please!

There is also another duplicated PR that proposes to migrate this module to v16. #265

@mcassuto
Copy link

mcassuto commented Jul 5, 2023

@aleuffre @alexeirivera87 @mamcode
Hi guys since there is 3 PR in total, what should we do now ?

@aleuffre
Copy link
Contributor

aleuffre commented Jul 5, 2023

Leave a review on all of them, or the one you think is closest to being merged, both in terms of code and in terms of the author being more active.

In terms of code I think this one is closest to being done, there are just a few changes to be made.

Happy to open a 4th PR myself, since I'd like to have this merged ASAP 🤣

@mcassuto
Copy link

mcassuto commented Jul 5, 2023

Ok let me check if it has been tested ok, I guess it is alreay done on production.

@alexeirivera87
Copy link
Author

Hello @mcassuto @aleuffre @mamcode

Yes, I did check the existing PR before submitting this one:

About #324 , on this migration the only thing the author did was to change the module version (and even this is not correct), and to remove a function that was failing in the tests.

About #265 , here the only thing that was done was to change the version of the module.

Regards

@aleuffre
Copy link
Contributor

aleuffre commented Jul 5, 2023

Hello @mcassuto @aleuffre @mamcode

Yes, I did check the existing PR before submitting this one:

About #324 , on this migration the only thing the author did was to change the module version (and even this is not correct), and to remove a function that was failing in the tests.

About #265 , here the only thing that was done was to change the version of the module.

Regards

In that case, we usually write superseds #number of the MR in the description, so we can keep track of such things. Thank you 🙏

@etobella
Copy link
Member

etobella commented Jul 6, 2023

Visually it works for me. Why did you remove the Regex on the test?

@aleuffre
Copy link
Contributor

@alexeirivera87 if you could please address the changes that were requested, they're minor things and I think this is pretty close to getting merged.

if you don't have time, I'd like to pick it up myself (I'd preserve ownership of your commits) since I need this module merged as well.

Thank you for your contributions!

@etobella
Copy link
Member

etobella commented Sep 6, 2023

@alexeirivera87 can you check the issue with the REGEX?

@alexeirivera87 alexeirivera87 force-pushed the 16.0-mig-maintenance_plan branch 2 times, most recently from e4b880d to bb3321f Compare January 30, 2024 15:11
@alexeirivera87
Copy link
Author

Hello @aleuffre @etobella

I reverted the changes in unit tests, so assertRegex is used as before.

Now I have to check why the test failed in method test_next_maintenance_date_02

Regards

@etobella
Copy link
Member

But the test seems unrelated to the regex. Can you check it¿

@alexeirivera87 alexeirivera87 force-pushed the 16.0-mig-maintenance_plan branch from bb3321f to 23e4e60 Compare February 1, 2024 12:55
@alexeirivera87
Copy link
Author

@etobella All tests passed.

Yes, the is related to dates. Some are failing when current date is January 30th or 31st.

regards

@etobella
Copy link
Member

etobella commented Feb 1, 2024

Wow!!! I see... that might happend every 4 years 😆

One option would be to use freezetime in order to avoid this. Can you try?

@victoralmau
Copy link
Member

Hi, sorry for being late.
Added freeze_time in the tests in v15 #371 but I see there are v15 changes missing in the commit history, can you add it?

The problem with the last days of the month is that the last day of the following month is not used (in those that are generated).

@alexeirivera87 alexeirivera87 force-pushed the 16.0-mig-maintenance_plan branch from 23e4e60 to 106a09d Compare February 1, 2024 18:01
@alexeirivera87
Copy link
Author

@victoralmau @etobella

It should be ok now.

regards

Copy link
Member

@victoralmau victoralmau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review OK

@etobella
Copy link
Member

etobella commented Feb 2, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-339-by-etobella-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 85bba0e into OCA:16.0 Feb 2, 2024
5 checks passed
@OCA-git-bot
Copy link
Contributor

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

@etobella
Copy link
Member

/ocabot migraion maintenance_plan

@OCA-git-bot
Copy link
Contributor

Hi @etobella. Your command failed:

Invalid command: migraion.

Ocabot commands

  • ocabot merge major|minor|patch|nobump
  • ocabot rebase
  • ocabot migration {MODULE_NAME}

More information

@etobella
Copy link
Member

/ocabot migration maintenance_plan

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Mar 11, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 11, 2024
24 tasks
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.