Stock Scrap Tier Validation: MRP compatibility

stock_scrap_tier_validation_mrp
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_scrap_tier_validation_mrp
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYStock
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLEYes
AUTHORS
AUTHORSOdoo Community Association (OCA), 360ERP
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), 360ERP
COMMITTERS
COMMITTERSStefan Rijnhart, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/stock-logistics-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:07
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/server-ux:
    - base_tier_validation
OCA/stock-logistics-workflow:
    - stock_scrap_tier_validation
odoo/odoo:
    - mrp
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - stock
    - barcodes_gs1_nomenclature
    - barcodes
    - digest
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
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.

Code Analysis

Views touched (0)

No views found for this module.

Models touched (2)

New fields (0)

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.

New fields (0)

No new fields.

Public methods (1)
  • button_scrap(self)
    Fix compatibility with stock_scrap_tier_validation