Tryton - Issues



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

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

msg39053 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-17.13:20:29
Yes, it will be great to clean all the project for migration before 2.x.
msg39048 (view) Author: [hidden] (prakashpp) Date: 2018-03-17.11:59:40
So should I send a patch for removing migrations before 2.x?
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:

It is not an exception, such migration should not be done in the code
but as a one shot query published on
msg33409 (view) Author: [hidden] (Timitos) Date: 2017-04-26.12:05:36
I think that there is already one exception to this rule:
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
msg33406 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) 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/", line 155, in init
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/", line 429, in load_modules
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/", line 398, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/", line 237, in load_module_graph
  File "/Users/prakashpandey/.virtualenvs/tryton/lib/python2.7/site-packages/trytond/modules/stock/", 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.
Date User Action Args
2018-03-17 13:20:30cedsetmessages: + msg39053
2018-03-17 11:59:40prakashppsetmessages: + msg39048
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)