Tryton - Issues

 

Issue9107

Title Unable to create complaing using relate
Priority bug Status resolved
Superseder Nosy List ced, pokoli, reviewbot, roundup-bot
Type crash Components sao, tryton
Assigned To ced Keywords review
Reviews 305231002
View: 305231002

Created on 2020-03-02.17:21:10 by pokoli, last changed by roundup-bot.

Messages
New changeset 2957c92409e6 by Cédric Krier in branch '5.4':
Filter leaf before preparing reference domain
https://hg.tryton.org/sao/rev/2957c92409e6

New changeset f8f57263a702 by Cédric Krier in branch '5.2':
Filter leaf before preparing reference domain
https://hg.tryton.org/sao/rev/f8f57263a702

New changeset 71ea04eb2994 by Cédric Krier in branch '5.0':
Filter leaf before preparing reference domain
https://hg.tryton.org/sao/rev/71ea04eb2994
New changeset 0a71713c74f8 by Cédric Krier in branch 'default':
Filter leaf before preparing reference domain
https://hg.tryton.org/tryton-env/rev/0a71713c74f8
New changeset 70093ddc4883 by Cédric Krier in branch 'default':
Filter leaf before preparing reference domain
https://hg.tryton.org/tryton/rev/70093ddc4883
New changeset dd902cf5a56d by Cédric Krier in branch 'default':
Filter leaf before preparing reference domain
https://hg.tryton.org/sao/rev/dd902cf5a56d
msg56926 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-04-06.14:36:40
formet msg56925, i've test with issue9202 and it worked correctly
msg56925 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-04-06.14:30:22
I've just tested all patches and know it does not crash but the domain inversion on the reference field does not allow to select the related sale.

So something it's not fully working
review305231002 updated at https://codereview.tryton.org/305231002/#ps313201002
msg56861 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-04-03.00:20:46
Here is review305231002 but to work properly it requires issue9199, issue9200 and issue9201.
msg56012 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-03-02.17:21:10
If an user tries to create a complaint from a sale the following exception is raised: 

KeyError: 'sale'
  File "trytond/protocols/dispatcher.py", line 186, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "trytond/model/modelsql.py", line 1247, in search
    tables, expression = cls.search_domain(domain)
  File "trytond/model/modelsql.py", line 1431, in search_domain
    expression = convert(domain)
  File "trytond/model/modelsql.py", line 1429, in convert
    domain[1:] if domain[0] == 'AND' else domain)))
  File "trytond/model/modelsql.py", line 1428, in <genexpr>
    return And((convert(d) for d in (
  File "trytond/model/modelsql.py", line 1426, in convert
    return Or((convert(d) for d in domain[1:]))
  File "trytond/model/modelsql.py", line 1426, in <genexpr>
    return Or((convert(d) for d in domain[1:]))
  File "trytond/model/modelsql.py", line 1418, in convert
    field = cls._fields[fname]

Steps to reproduce on a fresh database:

1. Create a complain type related to a sale
2. Create a new sale and process it.
3. Open the "Complaint" relate
4. Create a new record on the screen. 
5. Select "Sale" as origin and when trying to select a custom sale the exception above is raised.
History
Date User Action Args
2020-04-17 14:53:16roundup-botsetmessages: + msg57225
keyword: - backport
2020-04-10 18:33:23roundup-botsetmessages: + msg56984
2020-04-10 18:33:16roundup-botsetmessages: + msg56983
2020-04-10 18:33:14roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg56982
2020-04-06 14:36:40pokolisetmessages: + msg56926
2020-04-06 14:30:22pokolisetmessages: + msg56925
2020-04-03 00:49:58reviewbotsetnosy: + reviewbot
messages: + msg56863
2020-04-03 00:20:46cedsetstatus: in-progress -> testing
reviews: 305231002
component: + tryton, sao, - sale_complaint
messages: + msg56861
keyword: + backport, review
2020-04-02 22:38:34cedsetstatus: unread -> in-progress
assignedto: ced
nosy: + ced
2020-03-02 17:21:10pokolicreate

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