[DEL]Useless dependances + [ADD]Statement journal depending on bank account, statement line account depending on bank accont or partner if setted, statement line type
bzr revid: dle@openerp.com-20121206111816-c0t7mfy1x6seezev
This commit is contained in:
parent
28b988940f
commit
7232c1f986
|
@ -90,7 +90,7 @@ V2.2 specifications.
|
|||
If required, you can manually adjust the descriptions via the CODA configuration menu.
|
||||
''',
|
||||
'images' : ['images/coda_logs.jpeg','images/import_coda_logs.jpeg'],
|
||||
'depends': ['account_voucher','base_iban', 'l10n_be_invoice_bba', 'account_bank_statement_extensions'],
|
||||
'depends': ['account_voucher','base_iban', 'l10n_be_invoice_bba',],
|
||||
'demo': [],
|
||||
'data': [
|
||||
'l10n_be_coda_wizard.xml',
|
||||
|
|
|
@ -262,25 +262,39 @@ class account_coda_import(osv.osv_memory):
|
|||
line['counterpartyNumber'] = False
|
||||
except:
|
||||
pass
|
||||
partner = None
|
||||
partner_id = None
|
||||
if 'counterpartyNumber' in line and line['counterpartyNumber']:
|
||||
ids = self.pool.get('res.partner.bank').search(cr, uid, [('acc_number', '=', str(line['counterpartyNumber']))])
|
||||
if ids and len(ids) > 0:
|
||||
partner_id = self.pool.get('res.partner.bank').browse(cr, uid, ids[0], context=context).partner_id.id
|
||||
partner = self.pool.get('res.partner.bank').browse(cr, uid, ids[0], context=context).partner_id
|
||||
partner_id = partner.id
|
||||
if partner:
|
||||
if partner.customer:
|
||||
line['type'] = 'customer'
|
||||
else:
|
||||
partner_id = None
|
||||
line['type'] = 'supplier'
|
||||
if line['debit'] == '1':
|
||||
line['account'] = partner.property_account_payable.id
|
||||
else:
|
||||
line['account'] = partner.property_account_receivable.id
|
||||
else:
|
||||
line['type'] = 'general'
|
||||
if line['debit'] == '1':
|
||||
line['account'] = statement['journal_id'].default_debit_account_id.id
|
||||
else:
|
||||
line['account'] = statement['journal_id'].default_credit_account_id.id
|
||||
|
||||
|
||||
data = {
|
||||
'name': line['communication'],
|
||||
'note': "\n".join(note),
|
||||
'date': line['entryDate'],
|
||||
'amount': line['amount'],
|
||||
# 'type': '',
|
||||
'type': line['type'],
|
||||
'partner_id': partner_id,
|
||||
'account_id': 1, # TODO
|
||||
'account_id': line['account'],
|
||||
'statement_id': statement['id'],
|
||||
# 'analytic_account_id': '',
|
||||
# 'move_ids': '',
|
||||
'ref': line['ref'],
|
||||
'sequence': line['sequence'],
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue