From 492adc38a16ea8f90ef5c3109106febeca3ac58a Mon Sep 17 00:00:00 2001 From: pinky <> Date: Tue, 12 Dec 2006 09:16:20 +0000 Subject: [PATCH] ACCOUNT : invoice.py : move_line_id_payment_get now return the complete list of account lines associated with an invoice account.py : some comments bzr revid: pinky-f52d18e268f8abaad9bd85722658b8e4fab04fe8 --- addons/account/account.py | 6 ++++++ addons/account/invoice.py | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index ebd23f1b229..fcf35064d8f 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1085,6 +1085,12 @@ class account_move_line(osv.osv): val['account_id'] = id1 return {'value':val} + # + # type: the type if reconciliation (no logic behind this field, for infà) + # + # writeoff; entry generated for the difference between the lines + # + def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context={}): id_set = ','.join(map(str, ids)) lines = self.read(cr, uid, ids, context=context) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 9094f73d447..3de5a004ef2 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -182,17 +182,18 @@ class account_invoice(osv.osv): # Workflow stuff ################# - # return the id of the first move line which has the same account than the invoice + # return the ids of the move lines which has the same account than the invoice # whose id is in ids def move_line_id_payment_get(self, cr, uid, ids, *args): ml = self.pool.get('account.move.line') + res = [] for inv in self.read(cr, uid, ids, ['move_id','account_id']): if inv['move_id']: move_line_ids = ml.search(cr, uid, [('move_id', '=', inv['move_id'][0])]) for line in ml.read(cr, uid, move_line_ids, ['account_id']): if line['account_id']==inv['account_id']: - return [line['id']] - return [] + res.append(line['id']) + return res def copy(self, cr, uid, id, default=None, context={}): if not default: default = {}