-
-
Notifications
You must be signed in to change notification settings - Fork 576
Expand file tree
/
Copy pathmrp_production.py
More file actions
24 lines (19 loc) · 781 Bytes
/
mrp_production.py
File metadata and controls
24 lines (19 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright 2026 Open Source Integrators
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from odoo import models
from odoo.exceptions import UserError
class MrpProduction(models.Model):
_inherit = "mrp.production"
def action_confirm(self):
for production in self:
# Check if BOM is outdated before allowing confirmation
if production.is_outdated_bom:
raise (
UserError(
"Cannot confirm production order '%s'. "
"The BOM is outdated. Please update the BOM "
"or create a new production order."
)
% production.name
)
return super().action_confirm()