Crash when statment rule matches payment group
When importing a statment, if I click on the apply rules I get the following Traceback:
Traceback (most recent call last):
File "/trytond/wsgi.py", line 109, in dispatch_request
return endpoint(request, **request.view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/protocols/dispatcher.py", line 43, in rpc
return methods.get(request.rpc_method, _dispatch)(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/wsgi.py", line 75, in wrapper
return func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/protocols/wrappers.py", line 200, in wrapper
return func(request, pool, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/protocols/dispatcher.py", line 196, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/model/modelview.py", line 742, in wrapper
return func(cls, records, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pokoli/projectes/cuatrogotas/account.py", line 79, in apply_rules
super().apply_rules(statements)
File "/trytond/model/modelview.py", line 742, in wrapper
return func(cls, records, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/modules/account_statement_rule/account.py", line 41, in apply_rules
lines.extend(statement._apply_rules(rules))
File "/trytond/modules/account_statement_rule/account.py", line 52, in _apply_rules
yield from rule.apply(origin, keywords)
File "/home/pokoli/projectes/cuatrogotas/account.py", line 19, in apply
yield from super().apply(origin, keywords)
File "/trytond/modules/account_statement_rule/account.py", line 140, in apply
line = rule_line.get_line(origin, keywords)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/modules/account_statement_rule/account.py", line 327, in get_line
filter(None, self._get_related_to(
^^^^^^^^^^^^^^^^^^^^^
File "/trytond/modules/account_payment_clearing/statement.py", line 189, in _get_related_to
self._get_payment_group(origin, keywords),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/trytond/modules/account_payment_clearing/statement.py", line 241, in _get_payment_group
if len(groups) == 1:
^^^^^^^^^^^
TypeError: object of type 'account.payment.group' has no len()
Fault: object of type 'account.payment.group' has no len()