Issue 9762

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

Created on 2020-10-25.17:20:50 by risto3, last changed 2 months ago by roundup-bot.

Messages

New changeset 63fdf00aa263 by Cédric Krier in branch '5.8':
Skip unrequested combination of account-party for balance
https://hg.tryton.org/modules/account/rev/63fdf00aa263
New changeset d8f9d3c25cef by Cédric Krier in branch 'default':
Skip unrequested combination of account-party for balance
https://hg.tryton.org/tryton-env/rev/d8f9d3c25cef
New changeset 9dcbd317650a by Cédric Krier in branch 'default':
Skip unrequested combination of account-party for balance
https://hg.tryton.org/modules/account/rev/9dcbd317650a
Author: [hidden] (acaubet)
Date: 2021-03-01.20:59:28

Sorry, review308741002 it's not commited.

Author: [hidden] (acaubet)
Date: 2021-03-01.17:58:31

The review341071002 has not been commited, so this is still not working.

New changeset aa9386014e59 by Cédric Krier in branch '5.8':
Skip unrequested combination of account-party
https://hg.tryton.org/modules/account/rev/aa9386014e59
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
2021-03-16 00:46:12roundup-botsetkeyword: - backport
messages: + msg65535
2021-03-01 23:27:28roundup-botsetmessages: + msg65045
2021-03-01 23:27:23roundup-botsetmessages: + msg65044
status: testing -> resolved
2021-03-01 20:59:28acaubetsetmessages: + msg65040
2021-03-01 18:05:45cedsetkeyword: + backport
2021-03-01 17:58:31acaubetsetmessages: + msg65039
nosy: + acaubet
status: resolved -> testing
2020-12-13 12:47:01roundup-botsetkeyword: - backport
messages: + msg63048
status: testing -> resolved
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

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