- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 241
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][IMP] stock_picking_report_custom_description: update description #358
[15.0][IMP] stock_picking_report_custom_description: update description #358
Conversation
Hi @carlosdauden, |
def write(self, vals): | ||
res = super().write(vals) | ||
if vals.get("name"): | ||
self.env["stock.move"].search([("sale_line_id", "=", self.id)]).name = vals[ |
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 is not correct.
self.env["stock.move"].search([("sale_line_id", "=", self.id)]).name = vals[ | |
self.env["stock.move"].search([("sale_line_id", "in", self.ids)]).update({"name": vals["name"]}) |
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 about the in
operator, but you don't need update
, as dot notation serves also for writing in a multi-record.
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 @rousseldenis :). I just changed. As @pedrobaeza said, we don't need the update
anyway. I'll check v16, as this is a potential bug.
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.
Yes of course
Before this change only when the procurements where updated the sale line description would be propagated so if a user updated that description after the sale was confirmed it wouldn't be written to the picking move. Now every time the user changes the line it will be synced to the related moves. TT52171
1423f4d
to
69c403f
Compare
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.
@rousseldenis please remove your "requested changes".
/ocabot merge minor |
On my way to merge this fine PR! |
Congratulations, your PR was merged at 609fa24. Thanks a lot for contributing to OCA. ❤️ |
Partially backported from the v16 feature
Before this change only when the procurements where updated the sale line description would be propagated so if a user updated that description after the sale was confirmed it wouldn't be written to the picking move.
Now every time the user changes the line it will be synced to the related moves.
cc @Tecnativa TT52171
please review @pilarvargas-tecnativa @carlos-lopez-tecnativa