How is this working? Should the system need to be able to generate the former format for the past period? Is not there any version system? Is it common to have format changes?
But how did it happen that a format introduced in Tryton in 2018-10-01 is already invalid 2 months later? How are we going to prevent this from happening in the future?
Seriously, the authorities have given only 2 months to update all the systems in the country? If this is a frequent risk, we should probably about a way to update those report without the need to provide a new release.
WTF, what is that for a country? Are they doing on purpose to fail the country business?
So we need a proper solution for such screwed behavior, we are not going to change and make release every time some moron in the country decide to make changes.
For me there is no need of a new release. As far as new versions support the new changes older versions templates can be manually updated on the database.
I can propose a change (or upload a new template) for released versions which avoids changing python code.
> Is each future evolution would be solvable by just updating the template?
Well normally the file does not work because new fields are added and the previous template does not set any value for it. This is a fixed size file, so when setting new fields they are normally added at the end. Updating the template sets a fixed value for the previous format so the file will be read correctly after updating it.
> Should not we version the templates?
I do not think it's worth because only the latest file format is accepted by tax authority.
OK so as it is a report using the template engine, I think we could just update the report and avoid having to change the python code. So users from old version can use the new template on their version.