[FIX] CODA IMPORT
bzr revid: nel@tinyerp.com-20100721183719-kvtzdgo8vzc3fvdy
This commit is contained in:
@@ -890,7 +890,9 @@ class account_invoice(osv.osv):
|
||||
new_move_name = self.pool.get('account.move').browse(cr, uid, move_id).name
|
||||
# make the invoice point to that move
|
||||
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name})
|
||||
self.pool.get('account.move').post(cr, uid, [move_id])
|
||||
# Pass invoice in context in method post: used if you want to get the same
|
||||
# account move reference when creating the same invoice after a cancelled one:
|
||||
self.pool.get('account.move').post(cr, uid, [move_id], context={'invoice':inv})
|
||||
self._log_event(cr, uid, ids)
|
||||
|
||||
return True
|
||||
|
||||
@@ -208,7 +208,8 @@ class account_coda_import(osv.osv_memory):
|
||||
line=lines[value]
|
||||
reconcile_id = False
|
||||
if line['toreconcile']:
|
||||
rec_id = move_line_obj.search(cr, uid, [('name', '=', line['name']), ('reconcile_id', '=', False), ('account_id.reconcile', '=', True)])
|
||||
name = line['name'][:3] + '/' + line['name'][3:7] + '/' + line['name'][7:]
|
||||
rec_id = pool.get('account.move.line').search(cr, uid, [('name','=', name),('reconcile_id','=',False),('account_id.reconcile','=',True)])
|
||||
if rec_id:
|
||||
reconcile_id = statement_reconcile_obj.create(cr, uid, {
|
||||
'line_ids': [(6, 0, rec_id)]
|
||||
@@ -296,4 +297,4 @@ class account_coda_import(osv.osv_memory):
|
||||
|
||||
account_coda_import()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user