Tryton - Issues

 

Issue7483

Title Migration to 4.8 fails because of duplicated button
Priority bug Status resolved
Superseder Nosy List alex.melkoff, ced, reviewbot, roundup-bot
Type crash Components stock_package_shipping
Assigned To ced Keywords review
Reviews 74331002
View: 74331002

Created on 2018-05-31.14:13:22 by alex.melkoff, last changed by roundup-bot.

Messages
New changeset b88a281bf6d8 by Cédric Krier in branch '4.8':
Add migration for XML id rename of create_shipping button
https://hg.tryton.org/modules/stock_package_shipping/rev/b88a281bf6d8
New changeset 8bea4ccf6187 by Cédric Krier in branch 'default':
Add migration for XML id rename of create_shipping button
https://hg.tryton.org/tryton-env/rev/8bea4ccf6187
New changeset 285c483d8de5 by Cédric Krier in branch 'default':
Add migration for XML id rename of create_shipping button
https://hg.tryton.org/modules/stock_package_shipping/rev/285c483d8de5
review74331002 updated at https://codereview.tryton.org/74331002/#ps1
msg41289 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-06-06.16:39:07
Indeed it is a way to fix it.
This query could be run in the ShipmentOut.__register__ method as a migration from 4.6. Could you provide a patch?
msg41280 (view) Author: [hidden] (alex.melkoff) Date: 2018-06-06.16:17:45
Seems like an acceptable compromise. This SQL query seems to work:

UPDATE ir_model_data SET fs_id='shipment_out_create_shipping_button' WHERE module='stock_package_shipping' AND model='ir.model.button' AND fs_id='create_shipping_button';
msg41155 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-05-31.14:44:43
I think we can not do anything because series 4.6 has been released, it is too late. If we change back the id, we will create the same issue for user who created the database with 4.6 series.
We can only add a SQL query to https://discuss.tryton.org/t/migration-from-4-6-to-4-8/440
msg41154 (view) Author: [hidden] (alex.melkoff) Date: 2018-05-31.14:13:22
There is a button, that is created with stock.xml and id of that button was changed in https://bugs.tryton.org/issue6389, so if this module (stock_package_shipping) was installed in 4.6 there is a button with the same name but different id in database. So migration fails with the following error:

In tag record: model ir.model.button with id shipment_out_create_shipping_button.
...
UserError: The button name in model must be unique! -
History
Date User Action Args
2018-09-15 18:27:19roundup-botsetmessages: + msg43895
2018-09-14 08:28:02roundup-botsetmessages: + msg43879
2018-09-14 08:27:58roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg43878
2018-09-12 13:21:05reviewbotsetnosy: + reviewbot
messages: + msg43839
2018-09-12 13:10:03cedsetstatus: chatting -> testing
reviews: 74331002
type: crash
keyword: + review
assignedto: ced
2018-06-06 16:39:07cedsetmessages: + msg41289
2018-06-06 16:17:45alex.melkoffsetmessages: + msg41280
2018-05-31 14:44:44cedsetstatus: unread -> chatting
nosy: + ced
messages: + msg41155
2018-05-31 14:13:22alex.melkoffcreate

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