I have created a Customer and that customers has 3 contact person names. Now while creating the Sales Order, I want to select 1 contact person name from a list. How can I get only the names of the contact person into a field?
I have created a related field in my custom module and in the form view I have displayed it :
custom.py
customer_contact = fields.Char(related="partner_id.child_ids.name", string="Contact Person", )
custom_saleorder_views.xml
<xpath expr="//field[@name='partner_shipping_id']" position="after">
<!-- Add your fields or attributes here -->
<field name="customer_contact" />
</xpath>
I have displayed the field below the Delivery address.
Now when I select the customer in Sales Order form view, it gives only the first contact person name. The rest of the contact names are not displayed.
How to get a list of contact names in the field "customer_contact". As the default field type of 'name' field is 'Char', using many2one field in our custom module gives a error.