Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Question about migration of account.tax and related entity (in my case on l10n_be)

by
Coop IT Easy SC agréée, Rémy Taymans
- 22/11/2022 17:32:44
Dear Tom,
Dear Danny,

Thank you very much for your help. I will look at the resources you mentioned. :)

Best regards,

--
Rémy Taymans @ Coop IT Easy
+32 493 02 69 85 - <https://github.com/remytms>
<https://coopiteasy.be>

Quoting Tom Blauwendraat (2022-11-22 15:46:48)
> Hi Remy,
>
> We had the same problem in the migration of a few of our Dutch customers. My colleague Danny who is not on this list (yet, but he will sign up) worked on that and says the following:
>
> -----------------------------------------
>
> Dear Remy,
>
> We have had a very similar thing happen in our migration from 10 to 14, between 12 and 13 yes. Although some of the things you mentioned we did not encounter, I had no problem with account.account.tag's being deleted for example.
>
> Part of the problem with the tags is this, in 13.0 a new model, called account.tax.report.line has been introduced. Now in 13, some tags are defined in xml files as account.tax.report.line instead of account.account.tag (as they were before). The report line model is responsible for creating new account.account.tag records in python, prefixed with a minus and plus sign.
>
> So you are dealing with new account.account.tag records, while all your account move lines and other stuff is still linked to the old account.account.tag records. There is no direct link to old and new tag records, so you kind of have to 'know' which old account.account.tag records are replaced with which new account.tax.report.line records, and then you could map them.
> I took the route of remapping the old tags to the new tags, and that work can be viewed here: https://github.com/OCA/OpenUpgrade/blob/13.0/addons/l10n_nl/migrations/13.0.3.0/post-migration.py
> I've moved some of the code into helper functions: https://github.com/OCA/openupgradelib/blob/master/openupgradelib/openupgrade_130.py
> So I hope it will be easy enough to use those helper functions in your own script. Or maybe the convert_old_tax_tags_into_new_report_line_tags function of l10n_nl could even be completely reused? This is the function that does the mapping.
>
> Best regards,
> Danny de Jong
>
> ------------------
>
> With the following PS: ---> I noticed that the "l10n_be" migration scripts are missing from OpenUpgrade so that was the same as we encountered for l10n_nl

Reference