In res partner form I have a many2many field. But I do hide this field when is_company = False. So the question is, how can I fill up this field based on parent_id.
If is_company = False and parent_id = True i need to fill up multiply_pricelists_ids
from parent_id.multiply_pricelists_ids
<record id="view_res_partner_pricelist_form" model="ir.ui.view">
<field name="name">view.res.partner.pricelist.form</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.view_partner_property_form" />
<field name="context">{'readonly_by_pass': True}</field>
<field name="arch" type="xml">
<group name="sale" position="inside">
<field name="multiply_pricelists_ids" widget="many2many_tags" attrs="{{'invisible: [('is_company' ,'=', False)],'required':['|',('parent_id','=',False), ('is_company','!=',False)]}"/>
</group>
</field>
</record>