I am looking to add a customer field to the products screen. In my business problem, each product is assigned to one customer specifically. I tried copying the code from the Sales Order form, but that didn't work out - I got a label for my field, but no menu to select from. This is the line I added:
In my .py:
'x_cust_name': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, select=True, track_visibility='always'),
In my .xml:
<field name="x_cust_name" domain="[('customer','=',True)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": True}'/>
This hasn't worked so far. Is there a way to get a nice dropdown menu of customers to appear in the products form? Thanks!