From 314350efee60bb6f6679a633b56bf4b3c5fbed05 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 14 Sep 2016 19:21:33 +0200 Subject: [PATCH] Migration script should be perfect now --- account_usability/migrations/8.0.0.2/pre-migration.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_usability/migrations/8.0.0.2/pre-migration.py b/account_usability/migrations/8.0.0.2/pre-migration.py index b725b9b..99263b2 100644 --- a/account_usability/migrations/8.0.0.2/pre-migration.py +++ b/account_usability/migrations/8.0.0.2/pre-migration.py @@ -10,6 +10,8 @@ def migrate(cr, version): # in account_usability/account.py cr.execute( "UPDATE account_move_line SET name= " - "CASE WHEN name='/' THEN ref ELSE ref||' - '||name END " - "WHERE ref is not null AND journal_id in " + "CASE WHEN account_move_line.name='/' THEN account_move.name " + "ELSE account_move.name||' - '||account_move_line.name END " + "FROM account_move WHERE account_move_line.move_id = account_move.id " + "AND account_move_line.journal_id in " "(SELECT id FROM account_journal WHERE type in ('sale', 'sale_refund'))")