Hi,
I've a little problem that's related to this.
I have the following models (changed the names to not distract from
the problem):
class Model1(ModelSQL, ModelView):
_name = "model1.model1"
_description = __doc__
is_parent = fields.Boolean('This item is a parent', help='')
Model1()
class Model2(ModelSQL, ModelView):
_name = "model2.model2"
main_item = fields.Many2One('model1.model1', 'Main Item')
child_items = fields.Many2Many('model3', 'model2field',
'model1field', 'Example', help='',
domain = [
('parent', '=',
Eval('main_item'))
],
states = {
'invisible':
Not(Bool(Eval('_parent_main_item.is_parent'))),
},
)
Model2()
class Model3(ModelSQL, ModelView):
_name = "model3.model3"
model2field = fields.Many2One('model2.model2', 'Model 2 record',
help='')
model1field = fields.Many2One('model1.model1', 'Model 1 record',
help='')
Model3()
Basically in Model2 you select a main_item. If this main_item is a
parent, then the many2many field child_items should be visible so the
user can select its childs. The domain= part works, but the control is
always invisible regardless if a main_item is selected that is a
parent.
I'm probably overlooking something, but I can't see it...
What is the best way to debug this kind of issues?
Best regards,
Vincent
--
[email protected] mailing list