def migrate_tags_on_taxes(cr, registry):
 env = api.Environment(cr, SUPERUSER_ID, {})
 xml_records = env['ir.model.data'].search([('model', '=', 'account.tax.template'), ('module', 'like', 'l10n_%')])
 tax_template_ids = [x['res_id'] for x in xml_records.sudo().read(['res_id'])]
 for tax_template in env['account.tax.template'].browse(tax_template_ids):
  tax_id = env['account.tax'].search([('name', '=', tax_template.name), ('type_tax_use', '=', tax_template.type_tax_use), ('description', '=', tax_template.description)])
  if (len(tax_id.ids) == 1):
   tax_id.sudo().write({'tag_ids': [(6, 0, tax_template.tag_ids.ids)]})

def migrate_tags_on_taxes ( cr , registry ) : env = api . Environment ( cr , SUPERUSER_ID , { } ) xml_records = env [ 'ir.model.data' ] . search ( [ ( 'model' , '=' , 'account.tax.template' ) , ( 'module' , 'like' , 'l10n_%' ) ] ) tax_template_ids = [ x [ 'res_id' ] for x in xml_records . sudo ( ) . read ( [ 'res_id' ] ) ] for tax_template in env [ 'account.tax.template' ] . browse ( tax_template_ids ) : tax_id = env [ 'account.tax' ] . search ( [ ( 'name' , '=' , tax_template . name ) , ( 'type_tax_use' , '=' , tax_template . type_tax_use ) , ( 'description' , '=' , tax_template . description ) ] ) if ( len ( tax_id . ids ) == 1 ) : tax_id . sudo ( ) . write ( { 'tag_ids' : [ ( 6 , 0 , tax_template . tag_ids . ids ) ] } )
this is a utiliy function to help migrate the tags of taxes when the localization has been modified on stable version .