Issue 7439

Title
Access error when selecting party on invoice
Priority
bug
Status
resolved
Superseder
Remove company record rules (issue 4080)
Nosy list
ced, pokoli, reviewbot, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2018-05-17.15:30:43 by pokoli, last changed 51 months ago by roundup-bot.

Messages

New changeset 1380782037e6 by Cédric Krier in branch '4.8':
Limit the cache to only matching multivalue records
https://hg.tryton.org/trytond/rev/1380782037e6

New changeset 88007c10de63 by Cédric Krier in branch '4.6':
Limit the cache to only matching multivalue records
https://hg.tryton.org/trytond/rev/88007c10de63

New changeset 9808077d1b25 by Cédric Krier in branch '4.4':
Limit the cache to only matching multivalue records
https://hg.tryton.org/trytond/rev/9808077d1b25
New changeset d645aee76ab0 by Cédric Krier in branch 'default':
Limit the cache to only matching multivalue records
https://hg.tryton.org/trytond/rev/d645aee76ab0
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-05-21.12:27:22
> I do not see the link between this issue and the last 3 new reviews.

That was for issue7198. I've already fixed it.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-05-21.12:24:53
I do not see the link between this issue and the last 3 new reviews.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-05-18.09:58:42
I will provide a patch for issue4080 but just want to have clear if we want to have some simpler patch (as the one suggested) for released versions.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-05-17.23:58:57
To be clear for me this is similar to issue4081. We can not fix case by case because it will end by instantiate each record individually. Just like with access rights we would ended to run all the code as root.
Also I think the best way to progress on issue4080 is to reject any quick hack which just delay the work on the real issue.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-05-17.15:36:47
I'm against hacking multi-company design. The only correct solution is issue4080.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-05-17.15:33:36
I think issue4080 is the solution for this problem, but as this is affecting released series I'm proposing review50371002 to be applied on them.

I will include other modules if we agree on the design.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2018-05-17.15:30:43
A access error is raised when selecting a party on invoice when the following conditions are meet: 

1. The database has multiple companies with multiple charts of account created.
2. The companies have defined a default receivable and payable account.
3. The party has no receivable/payable account defined and thus it uses the default values. 

We've debugged the problem and found the that this is because the multivalue mixin returns the accounts of all companies, so when reading some value of the account all the instances are read (this is a tryton design to improve performance), and this breaks the access rules as the ids for other companies are read.
History
Date User Action Args
2018-06-29 12:05:06roundup-botsetmessages: + msg41979
2018-06-25 09:40:10roundup-botsetstatus: chatting -> resolved
nosy: + roundup-bot
messages: + msg41632
2018-05-21 12:27:22pokolisetreviews: 50371002, 46471002, 45171002, 45161002 -> 50371002
messages: + msg40798
2018-05-21 12:24:54cedsetmessages: + msg40797
2018-05-21 12:20:04reviewbotsetmessages: + msg40796
2018-05-21 12:20:03reviewbotsetreviews: 50371002, 46471002, 45171002 -> 50371002, 46471002, 45171002, 45161002
2018-05-21 12:20:02reviewbotsetmessages: + msg40795
2018-05-21 12:20:01reviewbotsetreviews: 50371002, 46471002 -> 50371002, 46471002, 45171002
2018-05-21 12:20:00reviewbotsetmessages: + msg40794
2018-05-21 12:19:59reviewbotsetreviews: 50371002 -> 50371002, 46471002

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