mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_translate_dialog: Search using '=' to target right field
Without this commit, ir.translation are searched using a LIKE, meaning that for a field called 'title', we'd get the translations of all the fields beginning with title on this model. Therefore, the returned value for field 'title' that is displayed in the widget will be the value of the last result returned by search_read, what could be anything beginning with title, and not necessarily the field title itself.
This commit is contained in:
@@ -25,7 +25,7 @@ class BaseModel(models.BaseModel):
|
||||
for name in field_names:
|
||||
|
||||
tr_read_res = self.env['ir.translation'].search_read([
|
||||
('name', 'like', '%s,%s' % (self._name, name)),
|
||||
('name', '=', '%s,%s' % (self._name, name)),
|
||||
('res_id', '=', rec_id),
|
||||
('lang', '!=', 'en_US')
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user