ModelSql.create: behavior depends on database (MySQL: OperationalError/ PostgreSQL : IntegrityError)
The behavior of method "ModelSql.create" [1] differs depending on the database
used (see [2] and the result [3] of the test "test_modelsql.ModelSQLTestCase" [4]).
When I try to create a new record with a missing required field,
"OperationalError" is raised with MySQL and "IntegrityError" is raised PostgreSQL.
We can choose "OperationalError" or "IntegrityError" according to value of
"CONFIG.options['db_type']", what do you think ?
By the way, there should be the same problem in "ModelSql.write" method.
[1] http://hg.tryton.org/trytond/file/f9b5bb6a80e1/trytond/model/modelsql.py#l341
[2] http://hg.tryton.org/trytond/file/f9b5bb6a80e1/trytond/tests/test_fields.py#l374
[3] trytond.tests.test_modelsql.ModelSQLTestCase
[4] http://hg.tryton.org/trytond/file/f9b5bb6a80e1/trytond/tests/test_modelsql.py