Fix translation of views by modules for issue491

This commit is contained in:
Cédric Krier committed 2008-11-01 22:26:31 +01:00
1 parent a4edd2766d
commit b6a2cfd8bf
1 file changed
+3 -1
+3 -1
View File
@@ -89,6 +89,7 @@ class View(OSV):
view_ids = self.search(cursor, 0, [
('model', '=', view.model),
('id', '!=', view.id),
('module', '=', view.module),
])
for view2 in self.browse(cursor, 0, view_ids):
tree2 = etree.fromstring(view2.arch)
@@ -129,9 +130,10 @@ class View(OSV):
cursor.execute('DELETE FROM ir_translation ' \
'WHERE name = %s ' \
'AND type = %s ' \
'AND module = %s ' \
'AND src NOT IN ' \
'(' + ','.join(['%s' for x in strings]) + ')',
(view.model, 'view') + tuple(strings))
(view.model, 'view', view.module) + tuple(strings))
return True
def delete(self, cursor, user, ids, context=None):