Skip to Content
This question has been flagged
1 Reply
13379 Views

Hi,

I have a 3 way relation that i show in my form using a fields.related object.

'event_training_id':fields.related('events_ids_registration', 'event_id', 'registration_ids', relation='event.event',  type='one2many', string='Event'

This show me the events in wich the hr.employee is registered, but as the hr.employee can be registered in a bunch of objects, i want to show only those that have a boolean field called is_training marked as True.

My doubt is if this is possible, as the field is_training is within the object event.event, and my related field in hr.employee. I tried with a domain="[('is_training','=',True)]" but to no luck.

Does anyone know if this is achievable? Thanks in advance.

Avatar
Discard
Best Answer

The related field are filtrable only if storeparameter is True. Related are, basically, function field and if them aren't stored, OpenERP can't search (and filter) them.

Avatar
Discard
Author

I tried adding the store=True to the related field, but then it gives me the error "ProgrammingError: column hr_employee.event_training_id does not exist" and if i remove the store=True it shows me field without issue. Isn't this the exact opposite behaviour of the store attribute?

Related Posts Replies Views Activity
3
Oct 22
20462
6
Dec 23
29180
3
May 24
3635
2
Dec 21
4120
1
Oct 21
2130