-
-
Notifications
You must be signed in to change notification settings - Fork 705
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
[17.0][OU-ADD] sale: Migration to 17.0 #4561
Conversation
/ocabot migration sale Depends on :
|
For each line (or batch of lines) of the analysis file where there's a nothing to do, you have to indicate why is nothing to do. It seems a bit weird that there's nothing to do on the DB schema part. |
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
Indeed, as said by pedro, please analyse the difference between V16 and V17.
I took a quick look. For exemple, new 'locked' and removal of 'done' state should be handled.
Thanks !
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @rvalyi. Thanks for the explanation. I allowed me to put all the odoo-module-diff comment in off-topic, as the current PR is about "sale" migration. Feel free to open dedicated issue if you want to talk about the akretion tool. thanks ! |
def _sale_sale_order(env): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
ALTER TABLE sale_order | ||
ADD COLUMN IF NOT EXISTS locked BOOLEAN, | ||
ADD COLUMN IF NOT EXISTS temp_state VARCHAR | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE sale_order | ||
SET temp_state = state | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE sale_order | ||
SET state = 'sale' | ||
WHERE state = 'done' | ||
""", | ||
) | ||
|
||
|
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.
Hi. Thanks for your patch !
question: why create a temporary field. I mean, you can simply add locked field, update the value (based on state = "done"), then update state = sale, where state = done). ?
convention: could change the name of the function, for a more explicit one. "def _sale_sale_order" is not very explicit. something like "def _sale_order_populate_locked_field" looks better. (or something like that.)
thanks !
During the execution of the tests in the pull request for the
This error occurs because the |
0f8e1e4
to
3e86cbd
Compare
3e86cbd
to
37dc02d
Compare
Hello! I think with this query, we can merge it with website_sale_digital
|
) | ||
openupgrade.delete_sql_constraint_safely( | ||
env, "sale", "sale_order", "sale_order_date_order_conditional_required" | ||
) |
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.
the ORM does this automatically
SET locked = True, state = 'sale' | ||
WHERE state = 'done' | ||
""", | ||
) |
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.
locking should be conditional on the creating user having the sale.group_auto_done_setting
group.
Better do this in post-migration anyways, then you don't need to create the column manually
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.
Hi, @hbrunn,
Thank you for your comment. You can proceed with the changes in this Pull Request, as we currently don’t have any hours allocated for contributions
@acpMicrocom done in #4691 @dansanti I think this belongs into the |
No description provided.