-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
[IMP] rename_fields : rename field also on custom view like the one used on dashboards #298
base: master
Are you sure you want to change the base?
Conversation
Hmm, why it said key error? Something is not right |
|
9bd2dc3
to
f659e7d
Compare
I haved test 2 cases where we gonna use rename_fields function
|
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 doubt this is going to be performant enough
openupgradelib/openupgrade.py
Outdated
@@ -582,6 +583,65 @@ def rename_columns(cr, column_spec): | |||
) | |||
|
|||
|
|||
def rename_field_on_dashboard(env, model, old_field, new_field): |
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.
This should be a private method.
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.
Maybe you 're right
f659e7d
to
b88c457
Compare
What about performance? |
93acdbc
to
d2e297c
Compare
I have a few changes, if you have time please review |
@@ -582,6 +583,65 @@ def rename_columns(cr, column_spec): | |||
) | |||
|
|||
|
|||
def _rename_field_on_dashboard(env, model, old_field, new_field, | |||
dashboard_view_data): | |||
for r in dashboard_view_data: |
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.
Do the search here and only if the view contains old_field
.
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.
Thanks for the review and suggestion, I'm quite busy at the moment so i will comeback with this ASAP. In the meantime, feel free to add some modification to this PR, i don't mind.
Kind regard,
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.
@pedrobaeza Forgive me, but is all you are suggesting is (in my simplistic ways)
if old_field not in r.arch:
continue
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.
More or less, for improving drastically the performance. The previous search shouldn't contain non matched results.
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.
Done i use ilike
search for ir.ui.view.custom
that contain the old_field
, is that ok? , also i rename the method and handle some of your comment, please review if you have time
This PR has the |
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.
Pending the scope of the search for better performance
55648d9
to
60a1ba2
Compare
60a1ba2
to
2ab6c90
Compare
My fear on this is that it affects a lot the performance. Have you performed a migration with and without this and measure the time for both? |
I did, but i haven't measured only test the script (it still lacking some cases). Next time i will try to measure and let you know |
At the end, it's to see: before the change, the migration lasts 20 minutes; after the change, it lasts 21 minutes. That's acceptable. But if you check it and it takes 40 minutes, then the performance should be analyzed. |
Yes, understood, will keep that in mind |
close #190