| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
from odoo import api, SUPERUSER_ID, Command |
| 3 |
|
| 4 |
|
| 5 |
def migrate(cr, version): |
| 6 |
env = api.Environment(cr, SUPERUSER_ID, {}) |
| 7 |
# Tag PCVIII is no longer referenced in the Balance Sheet: users should use PCVIII3 instead. |
| 8 |
if ( |
| 9 |
(tag_pcviii := env.ref('l10n_at.account_tag_l10n_at_PCVIII', raise_if_not_found=False)) |
| 10 |
and (tag_pcviii3 := env.ref('l10n_at.account_tag_l10n_at_PCVIII3', raise_if_not_found=False)) |
| 11 |
): |
| 12 |
env['account.account'].search([('tag_ids', '=', tag_pcviii.id)]).write({ |
| 13 |
'tag_ids': [Command.unlink(tag_pcviii.id), Command.link(tag_pcviii3.id)], |
| 14 |
}) |