Tryton - Issues

 

Issue6470

Title Old migration to rename packing to shipment is causing problem in upgrade
Priority bug Status chatting
Superseder Nosy List Timitos, ced, pokoli, prakashpp
Type crash Components sale, stock
Assigned To Keywords
Reviews

Created on 2017-04-26.10:55:32 by prakashpp, last changed by ced.

Messages
msg33411 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-04-26.12:50:06
On 2017-04-26 12:05, Korbinian Preisler wrote:
> I think that there is already one exception to this rule:
> http://hg.tryton.org/trytond/rev/54bf4c9151aa

It is not an exception, such migration should not be done in the code
but as a one shot query published on https://discuss.tryton.org/c/migration
msg33409 (view) Author: [hidden] (Timitos) Date: 2017-04-26.12:05:36
I think that there is already one exception to this rule:
http://hg.tryton.org/trytond/rev/54bf4c9151aa
msg33408 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-04-26.11:25:10
I agree that at some point we should remove old migration but the delay should be long enough to not discourage people who has been late to update.
I think we could have the rule to clean migration for 2 major release in the past. So this mean for release 4.x we could remove all migrations before 2.x.
This gives a delay of 5 years and still allow older to make the migration from major to major.
Also the cleaning should be done for all module at once and stated in the CHANGELOG of trytond.
msg33407 (view) Author: [hidden] (prakashpp) Date: 2017-04-26.11:14:49
Just realised the same is in sale module as well https://github.com/tryton/sale/blob/develop/sale.py#L271-L296
msg33406 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-04-26.11:02:45
One solution is to update the migration to avoid using a like operator and use the specific models instead. 

But yes, I agree that 1.2 is quite old.
msg33405 (view) Author: [hidden] (prakashpp) Date: 2017-04-26.10:55:31
I have defined a new model "shipment_packing_station" in my module. This module depends on stock. While upgrading register fails with following trace:

  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/pool.py", line 155, in init
    lang=lang)
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/__init__.py", line 429, in load_modules
    _load_modules()
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/__init__.py", line 398, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/__init__.py", line 237, in load_module_graph
    cls.__register__(module)
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/stock/shipment.py", line 194, in __register__
    & (model.module == module_name)))
psycopg2.IntegrityError: duplicate key value violates unique constraint "ir_model_model_uniq"
DETAIL:  Key (model)=(shipment_station) already exists.

I figured out the old migration is causing problem. How long do you support the migrations? 1.2 is very old now I guess? Let me, happy to send a patch.
History
Date User Action Args
2017-04-26 12:50:06cedsetmessages: + msg33411
2017-04-26 12:05:36Timitossetnosy: + Timitos
messages: + msg33409
2017-04-26 11:25:10cedsetnosy: + ced
messages: + msg33408
2017-04-26 11:14:50prakashppsetcomponent: + sale
messages: + msg33407
2017-04-26 11:02:45pokolisetstatus: unread -> chatting
nosy: + pokoli
messages: + msg33406
2017-04-26 10:55:32prakashppcreate

Showing 10 items. Show all history (warning: this could be VERY long)