Repository navigation
Conversation
This was referenced Oct 14, 2026
This was referenced Oct 14, 2026
hbrunn
requested changes
Oct 20, 2026
hbrunn
left a comment
Member
There was a problem hiding this comment.
thanks, but please remove uom_type from the select statement and the loop too then
hbrunn
approved these changes
Oct 20, 2026
Member
|
Please squash the commits together. |
Up to 18.0, one reference unit equals factor of a unit, whatever its uom_type: a bigger unit created in the UI stores factor = 1 / ratio (e.g. a dozen: 1/12). Using factor as is for bigger units inverted their ratio (a Box of 24 became 1/24 of a unit). The test data now creates the bigger units with factor_inv, as the UI does; the expected conversions are unchanged.
wasud
force-pushed
the
19.0-ou-fix-uom-bigger
branch
from
October 20, 2026 07:12
6d4462c to
5720f58
Compare
This branch has not been deployed
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.
uom/19.0.1.0/post-migration.pysetsrelative_factor = factorfor "bigger" units without an xmlid, and1 / factorfor the others. Up to 18.0, though,factorhas the same meaning for everyuom_type: one reference unit equalsfactorof the unit. A bigger unit created in the UI (field "Bigger Ratio" =factor_inv) is stored withfactor = 1 / ratio, e.g. a dozen hasfactor = 1/12. So the migrated ratio of every user-created bigger unit is inverted: a "Box of 24" becomes 1/24 of a Unit.This PR:
relative_factor = 1 / factorfor every type;factor_inv, as the 18.0 UI does. The current test data writesfactor: 1000000on a bigger unit, which the UI never produces, and is why the bug passed the test. The expected conversions are unchanged.How tested:
uom,data_uom_migration.pyloaded: Mm and MA stored withfactor = 1e-06, as from the UI.