Stock Scrap Tier Validation: MRP compatibility
stock_scrap_tier_validation_mrp · OCA/stock-logistics-workflow
-
Security25/25No findings
-
Activity12/25Last human commit 22 months ago
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 17.0
Heuristic over the facts below, not an audit · How it's computed
Description
This module fixes compatibility between stock_scrap_tier_validation and the
mrp module from Odoo. When scrapping products directly from the production
order form, the scrap record will open in the main window rather than in a
popup form.
This solves a technical issue with the validation flow: it is only after saving a record that validation can be requested, whereas in the case of a popup window the record is only saved when closing the window. If validation is required, this attempt to save the record will raise an exception.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 0
No views found for this module.
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 2
No new fields.
Public methods (1)-
button_scrap(self)Fix compatibility with stock_scrap_tier_validation. The way that super opens the scrap form in a popup window prevents the tier validation UI elements from being effective. The record is only saved when closing the popup. Given that it's only possible to check if the record needs validation after saving, the popup will always raise the 'validation required' error which blocks saving it. As a workaround, we open the unsaved scrap record in the main window so that it can be saved first and then be requested validation for in the usual way.
No new fields.
Public methods (1)-
button_scrap(self)Fix compatibility with stock_scrap_tier_validation