Hi Guys!
I'm not really great with coding, but i'm doing my best to understand basics. I have a custom field in odoo11 for port of destination (it's a combination of city and country):
PY:
destination = fields.Many2one('destination.location', string="Destination")
class DestinationLocation(models.Model):
_name = 'destination.location'
place = fields.Char(string="Place Name", required=True)
country_id = fields.Many2one('res.country', string='Country', required=True)
@api.multi
@api.depends('place', 'country_id')
def name_get(self):
result = []
for x in self:
name = x.place + ', ' + x.country_id.code
result.append((x.id, name))
return result
<xpath expr="//form/sheet/group/group/field[@name='partner_id']" position="after">
<field name="destination"/>
</xpath>
When I'm trying to type into Destination field - suggestions doesn't work. If I type name, that already exists - it doesn't suggest it to me, until i go to SEARCH MORE I pick it manually. And, but the way, even in SEARCH MORE window - search doesn't work. It is looking with ID rather than city name.
Any help appreciated.