Skip to content

Commit 55e54ae

Browse files
committed
[IMP] base: store explict field.translate
1 parent f1dd8f8 commit 55e54ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/util/records.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,12 @@ def add_ref(ref):
12191219
fields_with_values_from_xml |= {"arch_db", "name"}
12201220
else:
12211221
fields_with_values_from_xml = fields
1222+
if version_gte("saas~18.5"): # translate is varchar
1223+
sql_code = "SELECT name FROM ir_model_fields WHERE model = %s AND translate IS NOT NULL AND name IN %s"
1224+
else: # translate is boolean
1225+
sql_code = "SELECT name FROM ir_model_fields WHERE model = %s AND translate = true AND name IN %s"
12221226
cr.execute(
1223-
"SELECT name FROM ir_model_fields WHERE model = %s AND translate = true AND name IN %s",
1227+
sql_code,
12241228
[model, tuple(fields_with_values_from_xml)],
12251229
)
12261230
reset_translations = [fname for [fname] in cr.fetchall()]

0 commit comments

Comments
 (0)