[17.0][FIX] product_secondary_unit: unnecessary sec_uom_qty set.#9
Merged
Qlasta merged 1 commit into17.0-versadafrom Apr 30, 2025
Merged
Conversation
380db4f to
c1377db
Compare
oerp-odoo
reviewed
Apr 29, 2025
| for line in self: | ||
| if not line.secondary_uom_id: | ||
| line.secondary_uom_qty = 0.0 | ||
| if self.secondary_uom_qty != 0.0: |
There was a problem hiding this comment.
shouldn't we use float_is_zero when checking this?
7f9f85b to
89bebfd
Compare
89bebfd to
c1e63df
Compare
oerp-odoo
approved these changes
Apr 30, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Setting sec uom qty, triggers unnecessary calculation on lines, where sec uom id is not set (used).
task id - 25342
Description
Problem noticed with
sale_order_secondary_unitmodule,sale.order.linewhich inheritsproduct_secondary_unit_mixin.By creating sale order line from backend (not using UI, using connection) without
secondary_uom_idand setting customprice_unitresults wrongprice_subtotal- not using customprice_unit, but using price from pricelist.Current Behaviour
Run simple test on sale_order_secondary_unit module:
Test fails:
Expected Behavior
Test does not fail. Possible to set custom price unit with correct subtotal.
Proposed implementation
Remove unnecessary trigger: Set secondary_uom_qty when secondary_uom_id is not set, only if it is not 0.