[FIX] fields: convert selection value to int
When a string value is assigned to a selection field expecting integers, the value simply rejected. In such a case, convert the value to an integer before validating it.
This commit is contained in:
@@ -1798,6 +1798,8 @@ class Selection(Field):
|
||||
def convert_to_cache(self, value, record, validate=True):
|
||||
if not validate:
|
||||
return value or False
|
||||
if value and self.column_type[0] == 'int4':
|
||||
value = int(value)
|
||||
if value in self.get_values(record.env):
|
||||
return value
|
||||
elif not value:
|
||||
|
||||
Reference in New Issue
Block a user