Code review comment for lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-fix-related-balance-check

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Leonardo, thanks for the patch.

Instead of defining a function _us, you can use lambda for resolving that simple expression:

lambda self, cr, uid, ids, context=None: ids

The other store function is also bad constructed, because it's triggered on 'account.bank.statement', but you have to query 'account.statement.profile' object. This is the correct code (also putting arguments in their usual form):

def _get_statement_from_profile(self, cr, uid, ids, context=None):
    triggered = []
    profile_obj = self.pool['account.statement.profile']
    for profile in profile_obj.browse(cr, uid, ids, context=context):
        triggered += [st.id for st in profile.bank_statement_ids]
    return triggered

Regards.

review: Needs Fixing (code review)

« Back to merge proposal