-
Notifications
You must be signed in to change notification settings - Fork 1
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
[15.0][ADD] purchase_order_update_planned_date #59
base: 15.0
Are you sure you want to change the base?
Conversation
for picking in order.picking_ids: | ||
picking.write({'scheduled_date':new_date_planned}) |
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.
Is this really needed? In other words, if this code is removed, pickings scheduled_date
are not updated?
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.
no, scheduled_date takes the value of planned_date before updating it
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.
OK, could you investigate in purchase_stock
addon in which situations scheduled_date
is originally set depending on planned_date
?
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.
Function _prepare_stock_move_vals
returns values to create a stock.move record. Among them is date
(which would be scheduled_date
) which takes the value of date_planned
.
https://github.com/odoo/odoo/blob/15.0/addons/purchase_stock/models/purchase.py#L533
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.
Take a look a this:
Picking scheduled_date
is based on moves date
field. And date for moves actually depends on order planned_date
. So if we update date_planned
before the order is confirmed (in this implementation we make this after confirmation), this could be enough (when confirm operation is made, date_planned
is already the desired one at this moment, so moves are created at the first time with the right date and we don't need to update schedule_date
for picking, because is actually updated at this point). Is that possible or is it complicated? I don't really know
e52f67e
to
5455977
Compare
@dalonsod can you test it? |
…tion Some fixes: - Original code only update main date_planned (order header, not in lines). - Date Planned was updated before PO confirmation, and we need it after approval (which is the moment before e.g. picking creation).
Tested and still didn't work... I've made some changes, take a look at them, test them and ,then, we'll talk about this |
@dalonsod