In your domain, the account type is payable. This should be receivable for move lines with credits, which will give you the partners with credit > 0 for sure.
domain = \
[ ('reconcile_id', '=', False)
, ('account_id.type', '=', 'payable')
, ('company_id', '=', company_id)
, ('partner_id', '!=', False) # must be there in case there are imported lines without partner_id (Deloitte)
, ('state', '=', 'valid')
# , ('amount_to_pay', '>', 0) # see later in if statements
]
Dear Ferdinand,
In your domain, the account type is payable. This should be receivable for move lines with credits, which will give you the partners with credit > 0 for sure.
domain = \
[ ('reconcile_id', '=', False)
, ('account_id.type', '=', 'payable')
, ('company_id', '=', company_id)
, ('partner_id', '!=', False) # must be there in case there are imported lines without partner_id (Deloitte)
, ('state', '=', 'valid')
# , ('amount_to_pay', '>', 0) # see later in if statements
]