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
This commit is contained in:
pinky 2006-12-12 09:16:20 +00:00
parent 3d1dd15a3b
commit 492adc38a1
2 changed files with 10 additions and 3 deletions

View File

@ -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)

View File

@ -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 = {}