Please review this at http://codereview.appspot.com/542043/show
Affected files:
M trytond/model/fields/integer.py
M trytond/model/modelsql.py
Index: trytond/model/fields/integer.py
===================================================================
--- a/trytond/model/fields/integer.py
+++ b/trytond/model/fields/integer.py
@@ -11,7 +11,7 @@
_type = 'integer'
-class BigInteger(Field):
+class BigInteger(Integer):
'''
Define an integer field (``long``).
'''
Index: trytond/model/modelsql.py
===================================================================
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -355,9 +355,11 @@
for field_name in self._columns:
field = self._columns[field_name]
# Check required fields
- if field.required \
- and not hasattr(field, 'set') \
- and field_name not in ('create_uid',
'create_date'):
+ if field.required and \
+ not hasattr(field, 'set') and \
+ not isinstance(field, (fields.Interger,
+ fields.Float) and \
+ field_name not in ('create_uid',
'create_date'):
if not values.get(field_name):
self.raise_user_error(cursor2, 'required_field',
error_args=self._get_error_args(
@@ -876,10 +878,12 @@
continue
field = self._columns[field_name]
# Check required fields
- if field.required \
- and not hasattr(field, 'set') \
- and field_name not in \
- ('create_uid', 'create_date'):
+ if field.required and \
+ not hasattr(field, 'set') and \
+ not isinstance(field, (fields.Interger,
+ fields.Float) and \
+ field_name not in ('create_uid',
+ 'create_date'):
if not values[field_name]:
self.raise_user_error(cursor2,
'required_field',
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgp6b8qnPQwhv.pgp
Description: PGP signature
