Vauxoo / odoo-ifrs

Odoo ifrs_report module from addons-vauxoo
6 stars 26 forks source link

[ISSUE] Updating to new version problem creating new constrains. #67

Open nhomar opened 8 years ago

nhomar commented 8 years ago

Hello.

What I did.

git pull. -u ifrs_report -d bd-

And this error appear:

ALTER TABLE "ifrs_lines" ADD CONSTRAINT "ifrs_lines_sequence_ifrs_id_unique" unique(sequence, ifrs_id); 

Is impossible to execute due to records 
(sequence, ifrs_id)=(420, 16)

Are duplicated.

What I expect.

Update from 8.0 -> 8.0 being properly done with no errors on existent databases.

Recomendation:

Can you dedicate a little to bump the version properly in the module and reveiw first if a record is duplicated when you add a new SQL contraint in an stable version?

HOW:

You can use this approach with the migration api.

  1. In a folder called migration.

  1. Put the init scripts that should be executed BEFORE update. (pure SQL).

The number of the version should be the same than the one in openerp.py.

Recommendation:

  1. Look for elements which are duplicated.
  2. Set a title to them that force them to be reviewed checking if there is a GAP in the priority that allo simply bump a number in the priority.

For example:

If you find ifrs_id = 10 priority 10 twice.... then set to 11 the priority field and recheck until an spece is found. and mark with simple text the title.

Thanks.

PS: You can use this migration approach between 8 and 9 but it is a different topic.

nhomar commented 8 years ago

This is the referenced module in the images:

https://github.com/OCA/l10n-spain/tree/9.0/l10n_es