I need to get the total credit amount on all unreconciled entries and display it on a smart button.
def _compute_refund_balance(self):
for partner in self:
moveline_obj = self.pool.get('account.move.line')
movelines = moveline_obj.search_read(self._cr, self._uid, [('partner_id', '=', partner.id)], ['id', 'credit', 'debit'])
partner.compute_refund_balance = sum((line['credit']-line['debit']) for line in movelines)
I need something to add inside the function. I have tried adding ('unreconciled','=', True) but still no luck.
Thank you