Tryton - Issues

 

Issue6470

Title Old migration to rename packing to shipment is causing problem in upgrade
Priority bug Status resolved
Superseder Nosy List Timitos, ced, pokoli, prakashpp, reviewbot, roundup-bot
Type crash Components
Assigned To ced Keywords review
Reviews 52421002,60341002
View: 52421002, 60341002

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

Messages
New changeset 1adc2a0cc880 by Cédric Krier in branch 'default':
Remove migration before 3.0 in convert.py
https://hg.tryton.org/tryton-env/rev/1adc2a0cc880
New changeset 32cea659fb4e by Cédric Krier in branch 'default':
Remove migration before 3.0 in convert.py
https://hg.tryton.org/trytond/rev/32cea659fb4e
review60341002 updated at https://codereview.tryton.org/60341002/#ps20001
review60341002 updated at https://codereview.tryton.org/60341002/#ps1
msg43848 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-09-12.23:48:17
Re-open it because there are still some migration code in convert.py. Here is review60341002
New changeset 8fb1200a22ad by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/tryton-env/rev/8fb1200a22ad
New changeset 2cf55cf915c0 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/trytond/rev/2cf55cf915c0
New changeset d29b173a45f8 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/timesheet_cost/rev/d29b173a45f8
New changeset 078c4fb2ef34 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/stock_supply/rev/078c4fb2ef34
New changeset bc8c50d0a4a6 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/stock_product_location/rev/bc8c50d0a4a6
New changeset 22fa32ea5a69 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/stock_location_sequence/rev/22fa32ea5a69
New changeset a65b4dde0686 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/stock_forecast/rev/a65b4dde0686
New changeset ed7a0cc557b9 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/stock/rev/ed7a0cc557b9
New changeset ff9c6aa45531 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/sale_opportunity/rev/ff9c6aa45531
New changeset d1b9ed2d1bf3 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/sale/rev/d1b9ed2d1bf3
New changeset 8866e94136da by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/purchase_invoice_line_standalone/rev/8866e94136da
New changeset a3ccce3e24cd by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/purchase/rev/a3ccce3e24cd
New changeset 66aaa2a5c4e8 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/project/rev/66aaa2a5c4e8
New changeset af33c03658f4 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/product_price_list/rev/af33c03658f4
New changeset f76e8b90a807 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/product/rev/f76e8b90a807
New changeset 38824e65c100 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/party/rev/38824e65c100
New changeset e27e901b939c by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/dashboard/rev/e27e901b939c
New changeset 0dcf0658e5cc by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/analytic_account/rev/0dcf0658e5cc
New changeset 661f5d310cca by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/account_stock_anglo_saxon/rev/661f5d310cca
New changeset c763a1fbd729 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/account_statement/rev/c763a1fbd729
New changeset c413b81900f7 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/account_product/rev/c413b81900f7
New changeset 408e1e7366af by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/account_invoice/rev/408e1e7366af
New changeset 9cddfd3a1450 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/account_fr/rev/9cddfd3a1450
New changeset 1387ff68cfe8 by Cédric Krier in branch 'default':
Remove migration before 3.0
https://hg.tryton.org/modules/account/rev/1387ff68cfe8
review52421002 updated at https://codereview.tryton.org/52421002/#ps10052
review52421002 updated at https://codereview.tryton.org/52421002/#ps1
msg42637 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-08-05.12:26:38
Here is review52421002
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:
> 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) (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/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
2018-09-14 08:29:09roundup-botsetmessages: + msg43881
2018-09-14 08:29:05roundup-botsetstatus: testing -> resolved
messages: + msg43880
2018-09-13 18:38:33reviewbotsetmessages: + msg43870
2018-09-12 23:56:05reviewbotsetmessages: + msg43849
2018-09-12 23:48:17cedsetstatus: resolved -> testing
reviews: 52421002 -> 52421002,60341002
messages: + msg43848
2018-08-09 20:45:46roundup-botsetmessages: + msg42849
2018-08-09 20:45:41roundup-botsetmessages: + msg42848
2018-08-09 20:45:38roundup-botsetmessages: + msg42847
2018-08-09 20:45:35roundup-botsetmessages: + msg42846
2018-08-09 20:45:32roundup-botsetmessages: + msg42845

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