Merge pull request #1362 from ForgeFlow/13.0-fix-account_asset_management-migration-move-line-fixup

[13.0][FIX] account_asset_management: migration fixup
This commit is contained in:
Pedro M. Baeza
2022-03-24 17:47:34 +01:00
committed by GitHub

View File

@@ -8,7 +8,8 @@ def handle_account_invoice_move_migration(env):
env.cr,
"""
UPDATE account_move_line aml
SET asset_profile_id = ail.asset_profile_id, asset_id = ail.asset_id
SET asset_profile_id = COALESCE(ail.asset_profile_id, aml.asset_profile_id),
asset_id = COALESCE(ail.asset_id, aml.asset_id)
FROM account_invoice_line ail
WHERE aml.old_invoice_line_id = ail.id AND
(ail.asset_profile_id IS NOT NULL OR ail.asset_id IS NOT NULL)"""