[FIX] l10n_fr: 2014 tax update patch has removed obsolete templates, causing an error at module update

Due to the relationship between fiscal position
templates and tax templates, the removal of
obsolete tax templates may crash if the corresponding
fiscal positions are not deleted before.
In a recent l10n_fr patch [1] a number of
templates disappeared, which causes an error during
subsequent updates on databases where the obsolete
templates are still present.
      
As a workaround, we can force a deletion of
all fiscal position templates before loading
them. This is relatively safe because the templates
are not connected to live data, and will be
re-created during the update (except for the
obsolete ones which will be gone forever).

[1] addons 7.0 rev 9515 rev-id: odo@openerp.com-20131010114424-atzr3bl9e9diir2g

lp bug: https://launchpad.net/bugs/1240265 fixed

bzr revid: odo@openerp.com-20131021124748-x4jnibwyab4gam23
This commit is contained in:
Olivier Dony
2013-10-21 14:47:48 +02:00
parent 6ba45e5cbf
commit 6a3683f116
+6
View File
@@ -2,6 +2,12 @@
<openerp>
<data>
<!-- To solve bug 1240265, we have to delete all fiscal position templates before each update.
The valid ones will be re-created later during the update.
/!\ This must be executed *before* loading the fiscal position templates!! -->
<delete model="account.fiscal.position.template" search="[('chart_template_id','=',ref('l10n_fr_pcg_chart_template'))]"/>
<!-- = = = = = = = = = = = = = = = -->
<!-- Fiscal Position Templates -->
<!-- = = = = = = = = = = = = = = = -->