No-Null-Constraint in purchase/sale/invoice/picking_warn by migration 6.1 to 7.0

Asked by Dragan Stojkovic

By trying to run migration script I receive an Not-Null-Constraint for the values : purchase_warn, sales_warn,invoice_warn,picking_warn

2014-06-13 05:58:37,625 31575 ERROR P100_migrated openerp.sql_db: bad query: INSERT INTO res_partner (name, active) VALUES(E'Chris Stumbert',true) RETURNING id
Traceback (most recent call last):
  File "/var/tmp/openupgrade/7.0/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: FEHLER: NULL-Wert in Spalte »purchase_warn« verletzt Not-Null-Constraint

2014-06-13 05:58:37,625 31575 ERROR P100_migrated OpenUpgrade: base: error in migration script /var/tmp/openupgrade/7.0/server/openerp/addons/base/migrations/7.0.1.3/pre-migration.py: FEHLER: N
ULL-Wert in Spalte »purchase_warn« verletzt Not-Null-Constraint

2014-06-13 05:58:37,625 31575 ERROR P100_migrated OpenUpgrade: FEHLER: NULL-Wert in Spalte »purchase_warn« verletzt Not-Null-Constraint
Traceback (most recent call last):
  File "/var/tmp/openupgrade/7.0/server/openerp/openupgrade/openupgrade.py", line 471, in wrapped_function
    func(cr, version)
  File "base/migrations/7.0.1.3/pre-migration.py", line 231, in migrate
  File "base/migrations/7.0.1.3/pre-migration.py", line 190, in create_users_partner
  File "/var/tmp/openupgrade/7.0/server/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/var/tmp/openupgrade/7.0/server/openerp/sql_db.py", line 226, in execute
    res = self._obj.execute(query, params)
IntegrityError: FEHLER: NULL-Wert in Spalte »purchase_warn« verletzt Not-Null-Constraint

Question information

Language:
English Edit question
Status:
Expired
For:
OpenUpgrade Server Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#2

For reference, I'm posting my comment that I only seem to have sent out to the mailing list:

this happens when the users' partners are created. As the comment in that part of the base module's pre script says:

    If other modules set additional columns to
    required, the following will break. We may
    want to have a look at disabling triggers
    at that point.

It seems wiser to refactor to pass defaults in this query depending on the module install base. For now, if you know a bit of Python you can simply hack the 'no-message' default value for these columns into the query.