Domain Creation

To correct myself, I am trying to develop a domain which uses a field from a related many2one field in the current model. For example -

class DharamshalaFloors(ModelSQL, ModelView):
   """Dharamshala Floors"""

    _name_ = 'dharamshala.floor'

    name = fields.Char('Name')
    number = fields.Integer('Floor Number')



class DharamshalaCategory(ModelSQL, ModelView):
    'Dharamshala Category'

    _name_ = 'dharamshala.categ'

    name = fields.Char('Dharamshala Name', required=True)
    num_of_floors = fields.Integer('Number of Floors')


class Profile(Workflow, ModelSQL, ModelView):
    'Profile'

    _name_ = 'profile'


    preferred_dhramshala_categ = fields.Many2One(
        'dharamshala.categ',
        'Preferred Dhramshala')
    preferred_floor = fields.Many2One(
        'dharamshala.floor', 'Preferred Floor',
        domain=[
            ('number', '<=', Eval('preferred_dhramshala_categ.num_of_floors', 0))
        ],
    )

I want the user to select a preferred building which has the number of specific floors. And then the list of the preferred floors should come on the basis of the total number of floors in that building.

A post was merged into an existing topic: Domain Creation