-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[18.0][FIX] sale_order_secondary_unit: quantity resets to 0 with secondary UoM #3873
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
base: 18.0
Are you sure you want to change the base?
Conversation
|
Hi @pedrobaeza, can you check this PR? |
|
@sergio-teruel is more suitable than me for checking this. |
|
Hi @sergio-teruel could you check this? |
nicolascol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funcitonal LGTM
lav-adhoc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| if self.secondary_uom_id: | ||
| if line_uom_qty == 1.0: | ||
| self.secondary_uom_qty = 1.0 | ||
| self._onchange_helper_product_uom_for_secondary() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of _onchange_helper_product_uom_for_secondary(), you should call the _compute_helper_target_field_qty() method, otherwise when the product qty is 1 and makes the comparison (in the if) to insert 1 unit in the secondary unit, after introducing 1 unit in the secondary qty, it introduces again 1 unit in the product original qty and makes the convertion.
b738e3f to
78ef0a5
Compare
This PR fixes a bug where the product_uom_qty on a sale order line would reset to 0 when adding a product that uses a secondary unit of measure.
The logic that prevented this in previous versions was altered during the migration to v17 (#3385)