Tryton - Issues

 

Issue7808

Title Financial - Reporting - Journal Cash has not attribute credit_account
Priority bug Status resolved
Superseder Nosy List MR, ced, pokoli, reviewbot, roundup-bot
Type crash Components account
Assigned To ced Keywords review
Reviews 68331002
View: 68331002

Created on 2018-10-24.06:43:57 by MR, last changed by roundup-bot.

Messages
New changeset 83ce6ba286c4 by Cédric Krier in branch '5.0':
Base journal cash report on account kind receivable and payable
https://hg.tryton.org/modules/account/rev/83ce6ba286c4
New changeset 49e0aec093c9 by Cédric Krier in branch 'default':
Base journal cash report on account kind receivable and payable
https://hg.tryton.org/tryton-env/rev/49e0aec093c9
New changeset c2d7cfb335c9 by Cédric Krier in branch 'default':
Base journal cash report on account kind receivable and payable
https://hg.tryton.org/modules/account/rev/c2d7cfb335c9
msg44646 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-10-28.12:04:46
This is issue7824
msg44645 (view) Author: [hidden] (MR) Date: 2018-10-28.08:06:33
After patching (review68331002) report row is formed, but after click to this row GTK client freeze
New review68331002 at https://codereview.tryton.org/68331002/#ps1
msg44569 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-10-25.01:19:25
Here is review68331002 which is based on the account kind. It compute the debit/credit of all line which are not done on receivable nor payable accounts. I think it propose something quite similar to the previous version (and maybe even better as it take care of move not done with default accounts). I added also a test to ensure to no more break this report.
msg44568 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-10-25.00:45:46
This is because issue7450 removed the credit/debit account on journal without taking care of this report. We could add an account in the context but I find that does not make the report very useful.
Maybe we could make a join with write-off and payment method to select the accounts to use for the report. But this makes the report mainly useless without account_invoice.
Another solution would be to sum debit and credit only for account of kind payable and receivable.
msg44551 (view) Author: [hidden] (MR) Date: 2018-10-24.06:43:56
On clicking Financial - Reporting - Journal Cash Tryton 5.0 GTK and web client crash:

ERROR:tryton.common.common:Traceback (most recent call last):
  File "/trytond/model/modelstorage.py", line 1234, in __getattr__
    field = self._fields[name]
KeyError: 'credit_account'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 73, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    request, database_name, *request.rpc_params)
  File "/wrapt/wrappers.py", line 523, in __call__
    args, kwargs)
  File "/trytond/wsgi.py", line 44, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelsql.py", line 827, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/trytond/model/fields/function.py", line 102, in get
    return call(names)
  File "/trytond/model/fields/function.py", line 96, in call
    return method(records, name)
  File "/trytond/modules/account/journal.py", line 135, in get_debit_credit_balance
    if journal.credit_account else None)
  File "/trytond/model/modelstorage.py", line 1236, in __getattr__
    raise AttributeError('"%s" has no attribute "%s"' % (self, name))
AttributeError: "account.journal,3" has no attribute "credit_account"

"account.journal,3" has no attribute "credit_account"
ERROR:tryton.common.common:Traceback (most recent call last):
  File "/trytond/model/modelstorage.py", line 1234, in __getattr__
    field = self._fields[name]
KeyError: 'credit_account'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 73, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    request, database_name, *request.rpc_params)
  File "/wrapt/wrappers.py", line 523, in __call__
    args, kwargs)
  File "/trytond/wsgi.py", line 44, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelsql.py", line 827, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/trytond/model/fields/function.py", line 102, in get
    return call(names)
  File "/trytond/model/fields/function.py", line 96, in call
    return method(records, name)
  File "/trytond/modules/account/journal.py", line 135, in get_debit_credit_balance
    if journal.credit_account else None)
  File "/trytond/model/modelstorage.py", line 1236, in __getattr__
    raise AttributeError('"%s" has no attribute "%s"' % (self, name))
AttributeError: "account.journal,3" has no attribute "credit_account"

"account.journal,3" has no attribute "credit_account"
History
Date User Action Args
2018-11-25 22:00:25roundup-botsetmessages: + msg45011
2018-11-07 19:01:30roundup-botsetmessages: + msg44805
2018-11-07 19:01:28roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg44804
2018-10-28 12:04:46cedsetmessages: + msg44646
2018-10-28 08:06:33MRsetmessages: + msg44645
2018-10-25 01:26:36reviewbotsetnosy: + reviewbot
messages: + msg44570
2018-10-25 01:26:34reviewbotsetreviews: 68331002
keyword: + review
2018-10-25 01:19:26cedsetstatus: chatting -> testing
assignedto: ced
messages: + msg44569
2018-10-25 00:45:47cedsetstatus: unread -> chatting
nosy: + ced, pokoli
messages: + msg44568
2018-10-24 06:43:57MRcreate

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