Hello,
I am struggling a bit with something and I am hoping that somebody here with a lot more experience can help me.
I am creating a module where I have a few models, the relevant ones are:
- event
- venue
- hall
- stand
This module is to manage stands in tradeshows, so an event can have a lot of stands, but only one venue, and a venue can have many halls and each hall can have many stands.
At the moment it works, I am using Many2one fields to link everything up and it works. However, when I create a stand, I want to filter the options of the hall where the stand will be, to display only the available halls of the venue where the parent event is happening.
I have been trying to accomplish that filter by using this in the stand model:
event_id = fields.Many2one('dev.event', string='Event')
hall_id = fields.Many2one('dev.hall', string='Hall',
domain="[('venue_id','=','event_id.venue_id')]")
Although the code doesnt throw an error, it also doesnt show any results.
I also tried taking the aproach of using a function for the domain... but that fell beyond my current experience, so I couldnt make it work.
Any help will be greatly appreciated.