-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
[18.0][MIG] mrp_production_auto_validate: Migration to 18.0 #1469
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] mrp_production_auto_validate: Migration to 18.0 #1469
Conversation
Relying on onchange makes this value set only if the BOM is set manually on the Form view, what isn't the case when MO are created by running procurements.
- split values for create in dedicated function - post messages on MO with modified qty - split MOs on create only on procurements
Currently translated at 100.0% (16 of 16 strings) Translation: manufacture-14.0/manufacture-14.0-mrp_production_auto_validate Translate-URL: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_production_auto_validate/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: manufacture-14.0/manufacture-14.0-mrp_production_auto_validate Translate-URL: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_production_auto_validate/
Currently translated at 100.0% (16 of 16 strings) Translation: manufacture-14.0/manufacture-14.0-mrp_production_auto_validate Translate-URL: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_production_auto_validate/it/
Currently translated at 100.0% (16 of 16 strings) Translation: manufacture-14.0/manufacture-14.0-mrp_production_auto_validate Translate-URL: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_production_auto_validate/it/
Currently translated at 100.0% (16 of 16 strings) Translation: manufacture-14.0/manufacture-14.0-mrp_production_auto_validate Translate-URL: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_production_auto_validate/es/
"'Order Auto Validation' option." | ||
).format(qty=mo.bom_id.product_qty) | ||
|
||
qty_ok = tools.float_is_zero( |
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.
Why not sticking to float_compare here, like it was before?
The result won't be exactly the same.. with float_compare
, both values are rounded and then compared.
With your new suggestion, only their diff is rounded and checked against 0.
e.g.: for the sake of a dumb example, let's assume we are rounding to 0 decimals:
value1: 2.4
value2: 1.6
before:
round(value1) == round(value2)
round(2.4) == round(1.6)
2 == 2
now:
round(value1 - value2) == 0
round(2.4 - 1.6) == 0
round(0.8) == 0
1 == 0
"The Quantity To Produce of an order is now " | ||
"restricted to the BoM Quantity." | ||
) | ||
self.mo_auto_validation = False |
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.
We could take the opportunity to convert this into a computed field with store=True, readonly=False and precompute=True
role="alert" | ||
attrs="{'invisible': ['|', ('type', '!=', 'normal'), ('mo_auto_validation', '=', False)]}" | ||
/> | ||
invisible="type != 'normal' or mo_auto_validation == False" |
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.
or not mo_auto_validation
667df2b
to
549d07e
Compare
549d07e
to
f0a2d72
Compare
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.
Thanks
mo_auto_validation_warning
, we only show the warning<div/>
tag whenmo_auto_validation = True
mrp.immediate.production.line
was removed, we have to handlemrp.production.backorder
instead