Commit 2ca595a8 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Dont rely on grouping_date for outstanding amount

See merge request nexedi/slapos.core!435
parents c4872a03 419a820c
Pipeline #24028 passed with stage
in 0 seconds
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
portal = context.getPortalObject() portal = context.getPortalObject()
params = {"node_category_strict_membership": ['account_type/asset/receivable', params = {"node_category_strict_membership": ['account_type/asset/receivable',
'account_type/liability/payable']} 'account_type/liability/payable']}
if at_date: if at_date:
params['at_date'] = at_date params['at_date'] = at_date
params['grouping_query'] = ComplexQuery(
SimpleQuery(grouping_reference=None), params['grouping_reference'] = None
SimpleQuery(grouping_date=at_date, comparison_operator=">"),
logical_operator="OR")
else:
params['grouping_reference'] = None
if resource_uid is not None: if resource_uid is not None:
params["resource_uid"] = resource_uid params["resource_uid"] = resource_uid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment