OpenUpgrade mailing list archives

openupgrade@odoo-community.org

Avatar

[8.0 -> 9.0] Error in migration script account/migrations/9.0.1.1/post-migration.py

by
Sébastien Gendre
- 08/06/2020 13:14:09
While running a migration from Odoo 8.0 to 9.0, with OpenUpgrade 9.0, I
got an error:

```
ERROR migration_db OpenUpgrade: account: error in migration script
account/migrations/9.0.1.1/post-migration.py: NotNullViolation('null
value in column "account_id" violates not-null
constraint\nDETAIL:  Failing row contains (60046, 7, 2017-11-19
10:22:18.669788, 2020-06-09 10:23:01.738099, 1, null, null, null,
23505, 0.00, 0.00, 1, null, 0.00, null, 7305, null, null, 61, break,
percent,  , 0, null, null, 0, null, 0.0).\nCONTEXT:  SQL statement
"UPDATE ONLY "public"."account_invoice_line" SET "account_id" = NULL
WHERE $1 OPERATOR(pg_catalog.=) "account_id""\n',)

2020-06-05 14:18:12,482 60 ERROR migration_db OpenUpgrade: null value
in column "account_id" violates not-null constraint
DETAIL:  Failing row contains (60046, 7, 2017-11-19 10:22:18.669788,
2020-06-09 10:23:01.738099, 1, null, null, null, 23505, 0.00, 0.00, 1,
null, 0.00, null, 7305, null, null, 61, break, percent,  , 0, null,
null, 0, null, 0.0).
CONTEXT:  SQL statement "UPDATE ONLY "public"."account_invoice_line"
SET "account_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "account_id""
```

Openupgrade try to set null value to the field account_id. But this
field had the modifier set to not null.

-- 
Sébastien Gendre <sebastien.gendre@hasa.ch>

HASA sàrl
Rue de St-Jean 71
1201 Genève
+41 22 732 32 88
www.hasa.ch