Tryton - Issues

 

Issue7876

Title Server crash when trying to create a sale from opportunity domain
Priority bug Status testing
Superseder Nosy List ced, pokoli, reviewbot
Type crash Components sao
Assigned To pokoli Keywords review
Reviews 60451002
View: 60451002

Created on 2018-11-21.19:56:53 by pokoli, last changed by ced.

Messages
msg45039 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-11-26.22:18:19
But it is not what the review does nor explain in the title. So I'm confused.
msg45038 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-11-26.19:04:13
> I do not understand why in sao it requires to have a name and no on tryton?

localize_domain is defined as:

def localize_domain(domain, field_name=None, strip_target=False):

on true is called as:

localize_domain(domain, strip_target=True)

but on sao as

localize_domain(domain, true)

which should be:

localize_domain(domain, null, true) 

to be exactly the same equivalent as in tryton
msg45037 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-11-26.19:01:10
> Is not it related to issue7869?
At first look it does not look similar but I've tested issue7869 and it also fixes this case
msg45036 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-11-26.19:01:07
I do not understand why in sao it requires to have a name and no on tryton?
msg45035 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-11-26.18:51:12
> Why is not there the same fix for tryton?

Indeed tryton uses keyword arguments which allows to not set the name field as it's not used by the function code. 

I'm wondering if it will be better to use null on sao to keep the same behaviour or to set the value on both clients.
msg45010 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-11-25.16:23:44
Is not it related to issue7869?
msg45009 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-11-25.16:21:41
Why is not there the same fix for tryton?
review60451002 updated at https://codereview.tryton.org/60451002/#ps1
msg44971 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-11-22.09:29:43
Here is review60451002 that fixes it
msg44969 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-11-21.19:56:53
When following the next steps:

1. Create a sale opportunity
2. Use the relate action to open it's sales
3. Create a new sale from the new action
4. On the origin field, select "Sale Opportunity" model and use the magnifing glass to search for the opportunity. 

The following exceptions is raised:

Traceback (most recent call last):
  File "/usr/local/lib/python35/dist-packages/trytond/wsgipy", line 73, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python35/dist-packages/trytond/protocols/dispatcherpy", line 46, in rpc
    request, database_name, *requestrpc_params)
  File "/usr/local/lib/python35/dist-packages/trytond/wsgipy", line 44, in auth_required
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python35/dist-packages/trytond/protocols/wrapperspy", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/usr/local/lib/python35/dist-packages/trytond/protocols/dispatcherpy", line 176, in _dispatch
    result = rpcresult(meth(*c_args, **c_kwargs))
  File "/usr/local/lib/python35/dist-packages/trytond/model/modelsqlpy", line 1172, in search
    tables, expression = clssearch_domain(domain)
  File "/usr/local/lib/python35/dist-packages/trytond/model/modelsqlpy", line 1356, in search_domain
    expression = convert(domain)
  File "/usr/local/lib/python35/dist-packages/trytond/model/modelsqlpy", line 1354, in convert
    domain[1:] if domain[0] == 'AND' else domain)))
  File "/usr/local/lib/python35/dist-packages/trytond/model/modelsqlpy", line 1353, in <genexpr>
    return And((convert(d) for d in (
  File "/usr/local/lib/python35/dist-packages/trytond/model/modelsqlpy", line 1344, in convert
    expression = fieldconvert_domain(domain, tables, cls)
  File "/usr/local/lib/python35/dist-packages/trytond/model/fields/fieldpy", line 348, in convert_domain
    name, operator, value = domain
ValueError: too many values to unpack (expected 3)

On tryton the same steps work without problem
History
Date User Action Args
2018-11-26 22:18:19cedsetmessages: + msg45039
2018-11-26 19:04:13pokolisetmessages: + msg45038
2018-11-26 19:01:11pokolisetmessages: + msg45037
2018-11-26 19:01:07cedsetmessages: + msg45036
2018-11-26 18:51:12pokolisetmessages: + msg45035
2018-11-25 16:23:44cedsetmessages: + msg45010
2018-11-25 16:21:41cedsetnosy: + ced
messages: + msg45009
2018-11-22 09:36:26reviewbotsetnosy: + reviewbot
messages: + msg44972
2018-11-22 09:29:44pokolisetstatus: unread -> testing
reviews: 60451002
messages: + msg44971
keyword: + review
assignedto: pokoli
2018-11-21 19:56:53pokolicreate

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