What I've done:
I have a module with
myfield = fields.Many2one('res.partner', string="Graduate", domain=[('is_graduated', '=', True)])
Then I have another class with
_inherit = 'res.partner'
is_graduated = fields.Boolean("Graduated before?", default=False)
graduations = fields.Many2many('my_module.courses', string="Graduation courses")
What I get:
The myfield
works good, but the graduations
field is empty. If you edit user 1
profile you can add entries to graduation
field using Add item
, but I need it to be filled automaticaly.
What I expect:
I expect that every record where myfield
is set to lets say user 1
, will be visible in field graduations
when you open user 1
profile. When I create record and set myfield
value to lets say user 1
, that record must to be visible in user 1
profile in the field graduations
. How to achieve that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…