[7.0] unable to update openerp if ln10_fr is installed (related to VAT change)

Bug #1240265 reported by Sylvain LE GAL (GRAP)
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

Hi.

I think there is a bug introduced in the rev 9515.

== Initial config :
~openerp/openobject-addons/7.0 - revision #9514
~openerp/openobject-server/7.0 - revision #5100
~openerp/openerp-web/7.0/ - revision #4037

== Step to reproduce the bug :
- Create a new database ;
- Install l10n_fr ;
- Configuring accounting data, choose "France - Comptabilité" and follow with default values ;
- Stop server
- bzr pull at last revision openobject-addons (tested with #9523)
- run server, updating all
- You have an error.

"2013-10-15 22:34:59,700 6483 ERROR base_created_9514 openerp.sql_db: bad query: delete from account_tax_template where id IN (11)"

(See attachment for complete stacktrace)

Possible origin :
There is some mistake in the last MP #9515. xml_ids are deleted. (Maybe it's better to create new account.tax.template instead of replace existing account.tax.template)

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :
summary: - unable to update openerp if ln10_fr is installed (related to VAT change)
+ [7.0] unable to update openerp if ln10_fr is installed (related to VAT
+ change)
Revision history for this message
Jean-Michel (jeanmichel-awad) wrote :

Hello,

Same issue here. There definitly is a bug in this revision.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

You're right, this is probably caused by the removal of obsolete templates in the French Accounting Chart when Camptocamp's patch for 2014 taxes was applied. We missed the fact that the chart templates records were not in "noupdate" mode, so the system tries to delete them during the next update. This step fails because the tax templates are removed before the corresponding fiscal positions.

As a workaround you can try to delete all "fiscal position templates" before trying to update.

This problem might have been avoided by adapting the existing templates instead of dropping them and creating new ones.

There are many possible solutions but we should try to find the one that has the lowest possible risk (i.e. no change to the framework and no change to the template models). The solution might be to add a <delete ref="old.id"/> record at the beginning of the chart of account definition for each fiscal.position that was removed in the patch.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
milestone: none → 7.0
status: New → Confirmed
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Hi.

Thank you for seeing the problem.

About the possible solution, maybe the best is to revert the MP from the trunk and to work quietly on fixing the MP ? it isn't ?

Because the software also propose to new customers who install l10n_fr today the new VAT prematurely. It's not good either.

Regards.

Revision history for this message
Nicolas JEUDY (njeudy) wrote :

Hello,

I just poist a small patch that keep old tax xmlid and correct the problem.
I update several base to test it. I think it's ok.

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

It's a shame that the xml cannot be changed because the correct name is 'intermédiare' and not 'specifique'. Although it is only an id, it would have been good not to introduce confusion for next update.

Thanks Nicolas for the patch.

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Hi Nicolas,

Is it possible to do a Merge Proposal instead of a patch ?
Anyway I'll test it in a few days.

Thanks a lot for the patch.

Best Regards.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

It's a bit too late to change back to the previous XML IDs, as some people may have installed new databases with the new XML IDs, and they will have the exact problem you describe if they later update and the IDs have changed again.

I'd prefer a solution that works in all cases when you update, which is why I suggested an extra <delete/> node at the beginning of the chart. It should avoid the error without causing a new one.

The fix has been merged in addons 7.0 at revision 9535 rev-id: <email address hidden>

Changed in openobject-addons:
status: Confirmed → Fix Released
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

I didn't test the patch but thanks for your reactivity ! (review & merge)

Revision history for this message
Yann Papouin (yann-papouin) wrote :

VATs are not updated for me.
Why an --update=ln10_fr does not update an already existing/configured chart of accounts ?
Is that related to the fact that a chart is "installed" for a company ?

Revision history for this message
Sylvain LE GAL (n-legalsylvain) wrote :

There are 2 concepts : Template and VAT.

Template are updated, if you create a new company, the new VAT are available. It's OK. (not totally, because the change of VAT are not effective today)

VAT are not updated. You have to create new VAT and disable old VAT.

Regards.

Revision history for this message
Yann Papouin (yann-papouin) wrote :

Thank you Sylvain, watching into this help me.

That's a shame that nothing is there to link these items with their template (eg: a template_name/template_id fields). It would easily allow to update an existing chart of account without having to use artifacts like search based on name/code/description. And specially in this case where taxe's names and codes have changed since initial 7.0 release ...

For the record:
- The current 7.0 "l10n_fr" module [1] seems compatible with OpenERP 6.1.
- Into OpenERP 6.1, you have to be in the "Multi-Company" group to be able to see the "Template" menu in [ACCOUNTING] configuration.
- You can update an existing "Chart of Accounts" using a third party module [2]: account_chart_update
- Watch currently active bug reports [3] about "account_chart_update" since it actually contains some bugs and usability issues .
- You can update default tax assignment (accounts, products) using a third party module [4]: trp_update_tax

[1] http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/files/9656/l10n_fr/
[2] https://launchpad.net/account-financial-tools
[3] https://bugs.launchpad.net/account-financial-tools?field.searchtext=account_chart_update
[4] https://launchpad.net/therp-addons

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.