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
[FW][FIX] sale: avoid crash when posting move linked to multiple SO #111366
Closed
fw-bot
wants to merge
1
commit into
odoo:saas-16.1
from
odoo-dev:saas-16.1-14.0-avoid_crash_multiple_so_per_invoice-pmo-SxLZ-fw
Closed
[FW][FIX] sale: avoid crash when posting move linked to multiple SO #111366
fw-bot
wants to merge
1
commit into
odoo:saas-16.1
from
odoo-dev:saas-16.1-14.0-avoid_crash_multiple_so_per_invoice-pmo-SxLZ-fw
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR targets saas-16.1 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@madprog ci/runbot failed on this forward-port PR |
Because of the M2M relation, an account.move.line can be linked to several sale.order.lines, making the cardinality of sale_line_ids superior to 1. Even if it is not possible to obtain this result with standard code, a custom module could create this situation and posting the invoice would result in a "ValueError: Expected singleton" exception. This commit prevents this exception by checking whether the line is linked to at least one downpayment SO line in the method action_post. The test also checks that the methods button_draft and button_cancel behave properly (spoiler alert: they will fail too in 16.0). X-original-commit: e1060eb
madprog
force-pushed
the
saas-16.1-14.0-avoid_crash_multiple_so_per_invoice-pmo-SxLZ-fw
branch
from
January 31, 2023 08:39
a88050f
to
17a269a
Compare
@Feyensv Sorry to disturb you again with this, but could you r+ this? 🙏 Thanks! |
@robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
Feb 2, 2023
Because of the M2M relation, an account.move.line can be linked to several sale.order.lines, making the cardinality of sale_line_ids superior to 1. Even if it is not possible to obtain this result with standard code, a custom module could create this situation and posting the invoice would result in a "ValueError: Expected singleton" exception. This commit prevents this exception by checking whether the line is linked to at least one downpayment SO line in the method action_post. The test also checks that the methods button_draft and button_cancel behave properly (spoiler alert: they will fail too in 16.0). closes #111366 X-original-commit: e1060eb Signed-off-by: Paul Morelle (pmo) <pmo@odoo.com> Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
fw-bot
deleted the
saas-16.1-14.0-avoid_crash_multiple_so_per_invoice-pmo-SxLZ-fw
branch
February 16, 2023 12:47
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because of the M2M relation, an account.move.line can be linked to several sale.order.lines, making the cardinality of sale_line_ids superior to 1.
Even if it is not possible to obtain this result with standard code, a custom module could create this situation and posting the invoice would result in a "ValueError: Expected singleton" exception.
This commit prevents this exception by checking whether the line is linked to at least one downpayment SO line in the method action_post. The test also checks that the methods button_draft and button_cancel
behave properly (spoiler alert: they will fail too in 16.0).
Closes #77195
Fixes #77028
Forward-Port-Of: #110633
Forward-Port-Of: #110560