) AS s
WHERE debit > 0 AND credit > 0 AND (last_reconciliation_date IS NULL OR max_date > last_reconciliation_date)
ORDER BY last_reconciliation_date""")
- ids = cr.fetchall()
- ids = len(ids) and [x[0] for x in ids] or []
- return self.pool.get('res.partner').name_get(cr, uid, ids, context=context)
+ ids = [x[0] for x in cr.fetchall()]
+ if not ids:
+ return []
+
+ # To apply the ir_rules
+ partner_obj = self.pool.get('res.partner')
+ ids = partner_obj.search(cr, uid, [('id', 'in', ids)], context=context)
+ return partner_obj.name_get(cr, uid, ids, context=context)
def reconcile_partial(self, cr, uid, ids, type='auto', context=None, writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False):
move_rec_obj = self.pool.get('account.move.reconcile')