Tryton - Issues

 

Issue8339

Title implicit dependency on account_deposit with account_payment_clearing
Priority bug Status testing
Superseder Nosy List ced, reviewbot, semarie
Type crash Components account_payment_clearing
Assigned To semarie Keywords review
Reviews 279371003
View: 279371003

Created on 2019-05-08.14:49:56 by semarie, last changed by ced.

Messages
review279371003 updated at https://codereview.tryton.org/279371003/#ps275421002
review279371003 updated at https://codereview.tryton.org/279371003/#ps261521002
msg49793 (view) Author: [hidden] (semarie) Date: 2019-05-22.08:40:51
I created a review based on tip, but the issue should be corrected on 5.2 too.

Does the behavior change (domain on Account relaxed, so show more possible accounts) will be good for backport too ?
msg49792 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-05-21.21:07:31
Yes, I mean: type.statement = balance
msg49791 (view) Author: [hidden] (semarie) Date: 2019-05-21.19:32:00
'statement' isn't a field on Account. do you mean 'type.statement' ?
msg49767 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-05-20.09:46:34
All the tree types receivable, payable and deposit are for account on balance sheet. So the domain of msg49706 is an superset of the current one but it does not require the dependency to account_deposit.
I think it is the simplest acceptable solution.
msg49763 (view) Author: [hidden] (semarie) Date: 2019-05-19.08:48:36
I am unsure to understand. What do you mean by "just ('statement', '=', 'balance')" ?

for what I understand of the problem, the domain for Account (in account_payment_clearing) is wrong when account_desposit isn't installed:

            ['OR',
                ('type.receivable', '=', True),
                ('type.payable', '=', True),
                ('type.deposit', '=', True),
                ],

because 'type.deposit' doesn't exist.
msg49706 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-05-10.23:05:25
This is because of the domain on Payment.account field. Indeed I think we should not use specific type here but just ('statement', '=', 'balance').
msg49669 (view) Author: [hidden] (semarie) Date: 2019-05-08.14:49:55
on tryton 5.2, with account_payment_clearing installed (and not account_deposit), I have the following traceback:

ERROR:tryton.common.common:Traceback (most recent call last):
  File "/trytond/wsgi.py", line 104, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 48, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 72, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 186, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelsql.py", line 1243, in search
    tables, expression = cls.search_domain(domain)
  File "/trytond/model/modelsql.py", line 1427, in search_domain
    expression = convert(domain)
  File "/trytond/model/modelsql.py", line 1425, in convert
    domain[1:] if domain[0] == 'AND' else domain)))
  File "/trytond/model/modelsql.py", line 1424, in <genexpr>
    return And((convert(d) for d in (
  File "/trytond/model/modelsql.py", line 1425, in convert
    domain[1:] if domain[0] == 'AND' else domain)))
  File "/trytond/model/modelsql.py", line 1424, in <genexpr>
    return And((convert(d) for d in (
  File "/trytond/model/modelsql.py", line 1422, in convert
    return Or((convert(d) for d in domain[1:]))
  File "/trytond/model/modelsql.py", line 1422, in <genexpr>
    return Or((convert(d) for d in domain[1:]))
  File "/trytond/model/modelsql.py", line 1415, in convert
    expression = field.convert_domain(domain, tables, cls)
  File "/trytond/model/fields/field.py", line 190, in wrapper
    return func(*args, **kwargs)
  File "/trytond/model/fields/many2one.py", line 239, in convert_domain
    target_domain, tables=target_tables)
  File "/trytond/model/modelsql.py", line 1427, in search_domain
    expression = convert(domain)
  File "/trytond/model/modelsql.py", line 1425, in convert
    domain[1:] if domain[0] == 'AND' else domain)))
  File "/trytond/model/modelsql.py", line 1424, in <genexpr>
    return And((convert(d) for d in (
  File "/trytond/model/modelsql.py", line 1414, in convert
    field = cls._fields[fname]
KeyError: 'deposit'

To reproduce:
- create a new Payment
- fill fields Journal and Party
- search for an Account

With account_deposit installed, the problem doesn't occurs.
History
Date User Action Args
2019-05-22 23:27:19cedsetstatus: chatting -> testing
assignedto: semarie
2019-05-22 19:23:41reviewbotsetmessages: + msg49823
2019-05-22 09:00:12reviewbotsetnosy: + reviewbot
messages: + msg49794
2019-05-22 08:40:52semariesetreviews: 279371003
messages: + msg49793
keyword: + review
2019-05-21 21:07:31cedsetmessages: + msg49792
2019-05-21 19:32:01semariesetmessages: + msg49791
2019-05-20 09:46:35cedsetmessages: + msg49767
title: implicit dependency on account_desposit with account_payment_clearing -> implicit dependency on account_deposit with account_payment_clearing
2019-05-19 08:48:37semariesetmessages: + msg49763
2019-05-10 23:05:25cedsetstatus: unread -> chatting
nosy: + ced
messages: + msg49706
2019-05-08 14:49:56semariecreate

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