diff options
| author | Olivier Dony <odo@openerp.com> | 2010-12-20 17:25:01 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2010-12-20 17:25:01 +0100 |
| commit | 0fedbb3215081590d6d7fc52bb29f56dedd271e1 (patch) | |
| tree | 610abdaf6a37ebba47ea0d7d76f1acb821bafd7a | |
| parent | afed2d47fe33aa6f3f0aa1c3de500e26f8bf40da (diff) | |
[FIX] fields.reference: don't accept half-defined references - second part of fix, in create()
lp bug: https://launchpad.net/bugs/604604 fixed
bzr revid: odo@openerp.com-20101220162501-v0xag7nwdhfij14f
| -rw-r--r-- | bin/osv/orm.py | 16 |
1 files changed, 1 insertions, 15 deletions
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()' |
