[FIX]Unexisting payment reference, wrong operator in sql req

bzr revid: dle@openerp.com-20121203165139-qov9jfk91wxv3qb9
This commit is contained in:
dle@openerp.com 2012-12-03 17:51:39 +01:00
parent 2bfd5ecdf7
commit 5d44b0f624
2 changed files with 3 additions and 6 deletions

View File

@ -246,7 +246,7 @@
<!-- CODA Processing -->
<menuitem name="CODA Processing" parent="account.menu_finance_bank_and_cash" id="menu_account_coda" sequence="40"/>
<menuitem name="Import CODA Files" parent="menu_account_coda" id="menu_account_coda_import" action="action_account_coda_import" sequence="41"/>
<menuitem name="Import CODA File" parent="menu_account_coda" id="menu_account_coda_import" action="action_account_coda_import" sequence="41"/>
<!-- CODA Files -->
<record model="ir.ui.view" id="view_account_coda_tree">

View File

@ -913,7 +913,7 @@ class account_coda_import(osv.osv_memory):
balance_start_check_date = statement['first_transaction_date'] or statement['date']
cr.execute('SELECT balance_end_real \
FROM account_bank_statement \
WHERE journal_id = %s and date < %s \
WHERE journal_id = %s and date <= %s \
ORDER BY date DESC,id DESC LIMIT 1', (statement['journal_id'], balance_start_check_date))
res = cr.fetchone()
balance_start_check = res and res[0]
@ -975,7 +975,7 @@ class account_coda_import(osv.osv_memory):
if line['type'] == 'information':
#Check if this line can be deleted. glob_id_stack marked as undefined here
#line['globalisation_id'] = glob_id_stack[-1][2]
line['globalisation_id'] = glob_id_stack[-1][2]
line_note = _('Transaction Type' ': %s - %s' \
'\nTransaction Family: %s - %s' \
'\nTransaction Code: %s - %s' \
@ -1035,7 +1035,6 @@ class account_coda_import(osv.osv_memory):
'type': 'coda',
'parent_id': glob_id_stack[-1][2],
'amount': line['globalisation_amount'],
'payment_reference': line['payment_reference']
})
line['globalisation_id'] = glob_id
glob_id_stack.append((glob_lvl_flag, glob_code, glob_id, glob_name))
@ -1201,7 +1200,6 @@ class account_coda_import(osv.osv_memory):
account_id = account_mapping_obj.account_id_get(cr, uid, **kwargs)
if account_id:
line['account_id'] = account_id
st_line_vals = {
'ref': line['ref'],
'name': line_name,
@ -1216,7 +1214,6 @@ class account_coda_import(osv.osv_memory):
'counterparty_currency': line['counterparty_currency'],
'account_id': line['account_id'],
'globalisation_id': line['globalisation_id'],
'payment_reference': line['payment_reference'],
'statement_id': bk_st_id,
'voucher_id': voucher_id,
'note': line_note,