Skip to content
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

Open
wants to merge 15 commits into
base: 18.0
Choose a base branch
from

Conversation

chaule97
Copy link

@chaule97 chaule97 commented Feb 3, 2025

  • I think we don't need field mo_auto_validation_warning, we only show the warning <div/> tag when mo_auto_validation = True
  • mrp.immediate.production.line was removed, we have to handle mrp.production.backorder instead

sebalix and others added 14 commits January 20, 2025 18:00
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(
Copy link
Contributor

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
Copy link
Contributor

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"
Copy link
Contributor

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

@chaule97 chaule97 force-pushed the 18.0-mig-mrp_production_auto_validate branch from 667df2b to 549d07e Compare February 7, 2025 02:12
@chaule97 chaule97 force-pushed the 18.0-mig-mrp_production_auto_validate branch from 549d07e to f0a2d72 Compare February 7, 2025 02:26
Copy link
Contributor

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants