summaryrefslogtreecommitdiff
path: root/odoo/fields.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/fields.py')
-rw-r--r--odoo/fields.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/odoo/fields.py b/odoo/fields.py
index 710663866d0..8e940a3a387 100644
--- a/odoo/fields.py
+++ b/odoo/fields.py
@@ -1497,7 +1497,7 @@ class _String(Field):
update_trans = True
elif lang != 'en_US' and lang is not None:
# update the translations only except if emptying
- update_column = cache_value is None
+ update_column = not cache_value
update_trans = True
# else: lang = None
@@ -1507,7 +1507,7 @@ class _String(Field):
for rid in real_recs._ids:
# cache_value is already in database format
towrite[rid][self.name] = cache_value
- if self.translate is True and cache_value is not None:
+ if self.translate is True and cache_value:
tname = "%s,%s" % (records._name, self.name)
records.env['ir.translation']._set_source(tname, real_recs._ids, value)
if self.translate:
@@ -1530,7 +1530,7 @@ class _String(Field):
source_recs[self.name] = value
source_value = value
tname = "%s,%s" % (self.model_name, self.name)
- if value is None:
+ if not value:
records.env['ir.translation'].search([
('name', '=', tname),
('type', '=', 'model'),