i have been trying to get the records from res.partner model and filled the fiels att depeding upon the record
here is what i want the outcome.
when the partner_id has the attribute is_company is true from res.partner
want to fill the all user under that country in att field if its individual then only that company record to be filled in that field so im confused that im using the domain correctly whatso ever but i'm not getting the outcome as expected.
this is code snipet
partner_id = fields.Many2one('res.partner', string='Partner') att = fields.Many2one('res.partner', string='Attendee') @api.onchange('partner_id') def _onchange_partner_id1(self): for rec in self: if rec.partner_id: if rec.partner_id.is_company: return { 'domain': {'att': [('id', 'in', rec.partner_id.child_ids.ids)]} } else: return { 'domain': {'att': [('id', '=', rec.partner_id.id)]} } else: return { 'domain': {'att': []} }
appreciate for helping.