This question has been flagged
1 Reply
7394 Views

I have a custom module. My Many2one field  is

parent_id = fields.Many2one('res.partner', domain=[('is_company', '=', True)], string="Company")

Notes

I create the company from the module But it shows company type as individual.How can i default change as company.Thanks in advance

Avatar
Discard
Best Answer

Hi,

add in your code or xml view the context default_is_company. E.g.:

parent_id = fields.Many2one('res.partner', domain=[('is_company', '=', True)], string="Company", context="{'default_is_company': True}")

Or

<field name="parent_id" context="{'default_is_company': True}"/>
Avatar
Discard
Author

Thanks ITL