Greetings,
i want to change the domain of many2one field to present new records , the code worked fine but with wrong values
after i invoke the function : the values first will present the comanies name and if i click on one company , the values which i want (customer names ) will appeare .
how i can remove the first list which is the locations ? and from where this values retrieved i don't know .
My Code :
#------------PY
'customer_name':fields.many2one('res.partner'),
#------------XML
<field name="customer_name" widget="selection"/>
#---------- Function
cus_array=[]
myobj = self.pool.get('res.partner')
ids = myobj.search(cr, uid, [])
for id in ids:
customer = self.pool.get('res.partner').browse(cr, uid, [id], {})
if customer.country_id.id == customer_country:
cus_array.append(str(customer.name))
return {'domain':{'customer_name':[('name','=',cus_array)]}}