Issue 9762

Title
general ledger account parties problems
Priority
bug
Status
testing
Nosy list
ced, pokoli, reviewbot, risto3, roundup-bot
Assigned to
ced
Keywords
backport, review

Created on 2020-10-25.17:20:50 by risto3, last changed 4 days ago by risto3.

Messages

Author: [hidden] (risto3)
Date: 2020-11-28.23:35:30

That's better. Thanks

BTW, this filter should be by default as it seems somewhat rediculous to output null records if there have been no movements nor balance open for the party... on our base the filter takes on the order of 15 seconds to operate on a local test system!

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-11-28.22:18:21

Thanks for test too late.

Author: [hidden] (risto3)
Date: 2020-11-28.17:55:43

I grafted this onto 5.8 where it seems to make no difference:

Traceback (most recent call last):
  File "/opt/trytond/trytond/protocols/dispatcher.py", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/opt/trytond/trytond/model/modelsql.py", line 1268, in search
    tables, expression = cls.search_domain(domain)
  File "/opt/trytond/trytond/model/modelsql.py", line 1454, in search_domain
    expression = convert(domain)
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in convert
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in <genexpr>
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in convert
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in <genexpr>
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1449, in convert
    return Or((convert(d) for d in domain[1:]))
  File "/opt/trytond/trytond/model/modelsql.py", line 1449, in <genexpr>
    return Or((convert(d) for d in domain[1:]))
  File "/opt/trytond/trytond/model/modelsql.py", line 1442, in convert
    expression = field.convert_domain(domain, tables, cls)
  File "/opt/trytond/trytond/model/fields/function.py", line 79, in convert_domain
    return getattr(Model, self.searcher)(self.name, domain)
  File "/opt/trytond/trytond/modules/account/account.py", line 1724, in search_account
    ids = [a.id for a in accounts
  File "/opt/trytond/trytond/modules/account/account.py", line 1725, in <listcomp>
    if operator_(getattr(a, fname), operand)]
  File "/opt/trytond/trytond/model/fields/function.py", line 130, in __get__
    return super().__get__(inst, cls)
  File "/opt/trytond/trytond/model/fields/field.py", line 339, in __get__
    return inst.__getattr__(self.name)
  File "/opt/trytond/trytond/model/modelstorage.py", line 1585, in __getattr__
    read_data = self.read(list(index.keys()), list(ffields.keys()))
  File "/opt/trytond/trytond/model/modelsql.py", line 859, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/opt/trytond/trytond/model/fields/function.py", line 106, in get
    return dict((name, call(name)) for name in names)
  File "/opt/trytond/trytond/model/fields/function.py", line 106, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/opt/trytond/trytond/model/fields/function.py", line 99, in call
    return method(records, name)
  File "/opt/trytond/trytond/modules/account/account.py", line 1358, in get_balance
    return Account._cumulate(
  File "/opt/trytond/trytond/modules/account/account.py", line 1034, in _cumulate
    previous_result = func(accounts, names)
  File "/opt/trytond/trytond/modules/account/account.py", line 1357, in func
    return {names[0]: cls.get_balance(records, names[0])}
  File "/opt/trytond/trytond/modules/account/account.py", line 1344, in get_balance
    id_ = account_party2id[(account_id, party_id)]
KeyError: (588, 713)
New changeset a371949e7e46 by Cédric Krier in branch 'default':
Skip unrequested combination of account-party
https://hg.tryton.org/tryton-env/rev/a371949e7e46
New changeset bd55a6757068 by Cédric Krier in branch 'default':
Skip unrequested combination of account-party
https://hg.tryton.org/modules/account/rev/bd55a6757068
Author: [hidden] (risto3)
Date: 2020-10-25.17:20:50

unfortunately, we tried to use this on a copy of our production base to generate auxiliaire GL & balance reports but it seems they're not yet implemented (nor is l10n yet)... cannot select multiple accounts GL accounts (perhaps that's TBD too)

But there is a problem with filters once in the account parties screen to filter out all the zero records.
(what could these possibly mean in an auxiliairy report anyway?)

With the following filter line : "Start Balance": !0 or Debit: !0 or Credit: !0

Traceback (most recent call last):
  File "/opt/trytond/trytond/protocols/dispatcher.py", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/opt/trytond/trytond/model/modelsql.py", line 1268, in search
    tables, expression = cls.search_domain(domain)
  File "/opt/trytond/trytond/model/modelsql.py", line 1454, in search_domain
    expression = convert(domain)
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in convert
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in <genexpr>
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in convert
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1451, in <genexpr>
    return And((convert(d) for d in (
  File "/opt/trytond/trytond/model/modelsql.py", line 1449, in convert
    return Or((convert(d) for d in domain[1:]))
  File "/opt/trytond/trytond/model/modelsql.py", line 1449, in <genexpr>
    return Or((convert(d) for d in domain[1:]))
  File "/opt/trytond/trytond/model/modelsql.py", line 1442, in convert
    expression = field.convert_domain(domain, tables, cls)
  File "/opt/trytond/trytond/model/fields/function.py", line 79, in convert_domain
    return getattr(Model, self.searcher)(self.name, domain)
  File "/opt/trytond/trytond/modules/account/account.py", line 1719, in search_account
    ids = [a.id for a in accounts
  File "/opt/trytond/trytond/modules/account/account.py", line 1720, in <listcomp>
    if operator_(getattr(a, fname), operand)]
  File "/opt/trytond/trytond/model/fields/function.py", line 130, in __get__
    return super().__get__(inst, cls)
  File "/opt/trytond/trytond/model/fields/field.py", line 339, in __get__
    return inst.__getattr__(self.name)
  File "/opt/trytond/trytond/model/modelstorage.py", line 1585, in __getattr__
    read_data = self.read(list(index.keys()), list(ffields.keys()))
  File "/opt/trytond/trytond/model/modelsql.py", line 859, in read
    getter_results = field.get(ids, cls, field_list, values=result)
  File "/opt/trytond/trytond/model/fields/function.py", line 106, in get
    return dict((name, call(name)) for name in names)
  File "/opt/trytond/trytond/model/fields/function.py", line 106, in <genexpr>
    return dict((name, call(name)) for name in names)
  File "/opt/trytond/trytond/model/fields/function.py", line 99, in call
    return method(records, name)
  File "/opt/trytond/trytond/modules/account/account.py", line 1358, in get_balance
    return Account._cumulate(
  File "/opt/trytond/trytond/modules/account/account.py", line 1034, in _cumulate
    previous_result = func(accounts, names)
  File "/opt/trytond/trytond/modules/account/account.py", line 1357, in func
    return {names[0]: cls.get_balance(records, names[0])}
  File "/opt/trytond/trytond/modules/account/account.py", line 1344, in get_balance
    id_ = account_party2id[(account_id, party_id)]
KeyError: (588, 713)
History
Date User Action Args
2020-11-28 23:35:30risto3setmessages: + msg62282
2020-11-28 22:26:59reviewbotsetmessages: + msg62277
2020-11-28 22:20:43cedsetreviews: 308671002 -> 308671002,308741002
status: in-progress -> testing
2020-11-28 22:18:21cedsetmessages: + msg62276
status: chatting -> in-progress
2020-11-28 17:55:43risto3setmessages: + msg62275
status: resolved -> chatting
2020-11-27 22:38:57roundup-botsetmessages: + msg62262
2020-11-27 22:38:53roundup-botsetmessages: + msg62261
nosy: + roundup-bot
status: testing -> resolved
2020-11-21 10:22:51reviewbotsetmessages: + msg62080
nosy: + reviewbot
2020-11-21 10:22:28cedsetassignedto: ced
keyword: + backport, review
nosy: + ced
reviews: 308671002
status: unread -> testing
2020-11-17 00:39:16cedsettype: crash

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