Tryton - Issues

 

Issue9308

Title AccessError when clicking a link button on an unsaved record
Priority bug Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot
Type behavior Components sao, tryton
Assigned To pokoli Keywords review
Reviews 327381002
View: 327381002

Created on 2020-05-07.11:43:39 by pokoli, last changed by ced.

Messages
msg59273 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-07-10.23:52:32
It is rev ee690c4eec5b
msg59272 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-07-10.23:41:58
@ced we missed the tryron backport
New changeset b5b3fe01ebaf by Sergi Almacellas Abellana in branch '5.6':
Do not read rec_name of unsaved records
https://hg.tryton.org/sao/rev/b5b3fe01ebaf
New changeset 6a483c467651 by Sergi Almacellas Abellana in branch 'default':
Do not read rec_name of unsaved records
https://hg.tryton.org/tryton-env/rev/6a483c467651
New changeset 987243d660a1 by Sergi Almacellas Abellana in branch 'default':
Do not read rec_name of unsaved records
https://hg.tryton.org/tryton/rev/987243d660a1
New changeset f083aa46ac94 by Sergi Almacellas Abellana in branch 'default':
Do not read rec_name of unsaved records
https://hg.tryton.org/sao/rev/f083aa46ac94
review327381002 updated at https://codereview.tryton.org/327381002/#ps309991002
review327381002 updated at https://codereview.tryton.org/327381002/#ps317651002
review327381002 updated at https://codereview.tryton.org/327381002/#ps315531004
review327381002 updated at https://codereview.tryton.org/327381002/#ps305821002
review327381002 updated at https://codereview.tryton.org/327381002/#ps291891002
msg58449 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-06-03.21:34:35
Here is review327381002 that fixes it.
msg57866 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-05-07.12:02:30
I do not think we should save when clicking on Link because a Link will not always be on the top level form. So we can not trigger a partial save.
I do not think neither we should prevent to click on an unsaved record because the action may not depend on the record id.
I think the problem is in the code that tries to read an unsaved sale.
msg57865 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-05-07.11:43:38
Steps to reproduce: 

1. Create a new sale
2. Before saving it click the shipment link.

The following error is raised: 

'You are not allowed to read records "-3" of "Sale" because of at least one of these rules: User in company'

I won't expected an error here. 

I see several options here: 

* Save the record when clicking on the link (like other buttons)
* Make the links readonly until the record is saved.
History
Date User Action Args
2020-07-10 23:52:38cedsetstatus: chatting -> resolved
2020-07-10 23:52:32cedsetstatus: resolved -> chatting
messages: + msg59273
keyword: - backport
2020-07-10 23:42:08pokolisetstatus: chatting -> resolved
2020-07-10 23:41:59pokolisetstatus: resolved -> chatting
messages: + msg59272
keyword: + backport
2020-07-10 23:29:47roundup-botsetmessages: + msg59266
keyword: - backport
2020-07-06 17:40:58roundup-botsetmessages: + msg59022
2020-07-06 17:40:54roundup-botsetmessages: + msg59021
2020-07-06 17:40:52roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg59020
2020-07-04 20:03:44reviewbotsetmessages: + msg58971
2020-06-15 09:27:39reviewbotsetmessages: + msg58704

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