Upgrade to v1.6 issue with stock.location


#1

Upgrading an instance from 1.5 to 1.6 using:
flectra -c /etc/flectra/flectra.conf -d mydb -u all --stop-after-init
crashes the upgrade with the following logs:
2019-09-08 06:09:42,537 10153 INFO mydb flectra.addons.base.ir.ir_model: Deleting [email protected] (stock.stock_location_GR8-TSG-WCH)
2019-09-08 06:09:42,549 10153 ERROR mydb flectra.sql_db: bad query: b’DELETE FROM stock_location WHERE id IN (1655)’
ERROR: null value in column “location_id” violates not-null constraint
DETAIL: Failing row contains (3892, 174, null, null, 3222, WASH SOLUTION NO.3, BJ091126, 1, 0.000, null, Physical Locations/HHEPI/GR8-TSG-WCH, null, 490, 170410, 1, 1.000, 7, 2018-12-12 08:
25:17.32318, 1, 2019-09-08 05:32:17.846199).
CONTEXT: SQL statement “UPDATE ONLY “public”.“stock_inventory_line” SET “location_id” = NULL WHERE $1 OPERATOR(pg_catalog.=) “location_id””