[FIX] force factor to be 1 if reference unit#25465
Closed
fmdl wants to merge 1 commit intoodoo:masterfrom
Closed
Conversation
Contributor
|
cc @jem-odoo |
Contributor
|
@tde-banana-odoo If we are adding this constraint, i would do it in SQL directly, no ? |
Contributor
|
Rebased and merged at d5357e4, thanks ! |
Contributor
|
oups, sorry @jem-odoo, too slow, feel free to correct |
mart-e
pushed a commit
that referenced
this pull request
Aug 23, 2018
The _onchange_uom_type was already making sure it was the case but this constraint ensure it is always the case. Closes #25465
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.
Hi @bst-odoo @nim-odoo I don't find the fix for #22025 in master. Please find this following PR.
Description of the issue/feature this PR addresses:
There no constrains to force factor = 1 if it is a reference unit (there is only an onchange). It can be result some wrong compute with
_compute_quantity.Especially for the field
product_qtyinstock.move, which is a compute field fromproduct_uom_qty. If there are an factor on a Reference unit, the compute will be wrong.Because
_compute_quantitydoesn't check if it is a reference or no, and use anyway the stored factor.https://github.com/odoo/odoo/blob/11.0/addons/product/models/product_uom.py#L92.
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr