details: https://code.tryton.org/tryton/commit/f9b275530f28
branch: default
user: Cédric Krier <[email protected]>
date: Thu Jan 22 18:53:34 2026 +0100
description:
Prevent setting a phantom BoM on the BOM input and output with a
product already set
Closes #14536
diffstat:
modules/production/bom.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (34 lines):
diff -r 5841166dedee -r f9b275530f28 modules/production/bom.py
--- a/modules/production/bom.py Thu Jan 22 17:28:16 2026 +0100
+++ b/modules/production/bom.py Thu Jan 22 18:53:34 2026 +0100
@@ -173,10 +173,6 @@
})
phantom_bom = fields.Many2One(
'production.bom', "Phantom BOM",
- domain=[If(Eval('product', None),
- ('id', '=', None),
- ()),
- ],
states={
'invisible': Bool(Eval('product')),
'required': ~Bool(Eval('product')),
@@ -199,6 +195,9 @@
def __setup__(cls):
super().__setup__()
cls.phantom_bom.domain = [
+ If(Eval('product', None),
+ ('id', '=', None),
+ ()),
('phantom', '=', True),
('inputs', '!=', None),
]
@@ -325,6 +324,9 @@
def __setup__(cls):
super().__setup__()
cls.phantom_bom.domain = [
+ If(Eval('product', None),
+ ('id', '=', None),
+ ()),
('phantom', '=', True),
('outputs', '!=', None),
]