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

[15.0][IMP] stock_picking_report_custom_description: update description #358

Conversation

chienandalu
Copy link
Member

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

@OCA-git-bot
Copy link
Contributor

Hi @carlosdauden,
some modules you are maintaining are being modified, check this out!

def write(self, vals):
res = super().write(vals)
if vals.get("name"):
self.env["stock.move"].search([("sale_line_id", "=", self.id)]).name = vals[
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not correct.

Suggested change
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"]})

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Contributor

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
@chienandalu chienandalu force-pushed the 15.0-imp-stock_picking_report_custom_description-desc-update branch from 1423f4d to 69c403f Compare December 12, 2024 11:07
Copy link
Member

@pedrobaeza pedrobaeza left a 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".

@pedrobaeza
Copy link
Member

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 15.0-ocabot-merge-pr-358-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 70bfbc8 into OCA:15.0 Dec 12, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@pedrobaeza pedrobaeza deleted the 15.0-imp-stock_picking_report_custom_description-desc-update branch December 12, 2024 12:46
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.

6 participants