Skip to Content
Menu
This question has been flagged
1 Reply
7681 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

Related Posts Replies Views Activity
1
Aug 18
3166
2
Nov 24
25099
1
Oct 24
2893
2
May 24
5524
3
Mar 24
4967