diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 44219344519..dfd1376d4a5 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -3739,21 +3739,7 @@ class orm(orm_template): if field in self._columns \ and hasattr(self._columns[field], 'selection') \ and vals[field]: - if self._columns[field]._type == 'reference': - val = vals[field].split(',')[0] - else: - val = vals[field] - if isinstance(self._columns[field].selection, (tuple, list)): - if val not in dict(self._columns[field].selection): - raise except_orm(_('ValidateError'), - _('The value "%s" for the field "%s" is not in the selection') \ - % (vals[field], field)) - else: - if val not in dict(self._columns[field].selection( - self, cr, user, context=context)): - raise except_orm(_('ValidateError'), - _('The value "%s" for the field "%s" is not in the selection') \ - % (vals[field], field)) + self._check_selection_field_value(cr, user, field, vals[field], context=context) if self._log_access: upd0 += ',create_uid,create_date' upd1 += ',%s,now()'