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:
parent
3d1dd15a3b
commit
492adc38a1
|
@ -1085,6 +1085,12 @@ class account_move_line(osv.osv):
|
||||||
val['account_id'] = id1
|
val['account_id'] = id1
|
||||||
return {'value':val}
|
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={}):
|
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))
|
id_set = ','.join(map(str, ids))
|
||||||
lines = self.read(cr, uid, ids, context=context)
|
lines = self.read(cr, uid, ids, context=context)
|
||||||
|
|
|
@ -182,17 +182,18 @@ class account_invoice(osv.osv):
|
||||||
# Workflow stuff
|
# 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
|
# whose id is in ids
|
||||||
def move_line_id_payment_get(self, cr, uid, ids, *args):
|
def move_line_id_payment_get(self, cr, uid, ids, *args):
|
||||||
ml = self.pool.get('account.move.line')
|
ml = self.pool.get('account.move.line')
|
||||||
|
res = []
|
||||||
for inv in self.read(cr, uid, ids, ['move_id','account_id']):
|
for inv in self.read(cr, uid, ids, ['move_id','account_id']):
|
||||||
if inv['move_id']:
|
if inv['move_id']:
|
||||||
move_line_ids = ml.search(cr, uid, [('move_id', '=', inv['move_id'][0])])
|
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']):
|
for line in ml.read(cr, uid, move_line_ids, ['account_id']):
|
||||||
if line['account_id']==inv['account_id']:
|
if line['account_id']==inv['account_id']:
|
||||||
return [line['id']]
|
res.append(line['id'])
|
||||||
return []
|
return res
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context={}):
|
def copy(self, cr, uid, id, default=None, context={}):
|
||||||
if not default: default = {}
|
if not default: default = {}
|
||||||
|
|
Loading…
Reference in New Issue