we can add domain for field in both python file and xml file as bellow
E.G : let us say we have department_id file which it's domain must be the company
in python file :
department_id = fields.Many2one('hr.department', domain="[('company_id', '=', company_id)]", string="Department")
// the department object must has field call company_id and the current object too
in xml file :
<field name="department_id" domain="[('company_id','=',company_id)]"/>
No comments:
Post a Comment