[IMP] end error messages with a point instead of an exclamation point in account_coda

bzr revid: abo@openerp.com-20120807095820-7e6j6mh9u8gp6cny
This commit is contained in:
Antonin Bourguignon 2012-08-07 11:58:20 +02:00
parent a52eeef519
commit ca16c1d0a1
1 changed files with 159 additions and 160 deletions

View File

@ -54,7 +54,7 @@ class account_coda_import(osv.osv_memory):
codafile = data.coda_data
codafilename = data.coda_fname
except:
raise osv.except_osv(_('Error!'), _('Wizard in incorrect state. Please hit the Cancel button!'))
raise osv.except_osv(_('Error!'), _('Wizard in incorrect state. Please hit the Cancel button.'))
return {}
currency_obj = self.pool.get('res.currency')
@ -113,7 +113,7 @@ class account_coda_import(osv.osv_memory):
coda_statement['version'] = line[127]
coda_version = line[127]
if coda_version not in ['1','2']:
err_string = _('\nCODA V%s statements are not supported, please contact your bank!') % coda_version
err_string = _('\nCODA V%s statements are not supported, please contact your bank.') % coda_version
err_code = 'R0001'
if batch:
return (err_code, err_string)
@ -122,7 +122,7 @@ class account_coda_import(osv.osv_memory):
coda_statement['date'] = str2date(line[5:11])
period_id = period_obj.search(cr , uid, [('date_start' ,'<=', coda_statement['date']), ('date_stop','>=',coda_statement['date'])])
if not period_id:
err_string = _("\nThe CODA creation date doesn't fall within a defined Accounting Period!" \
err_string = _("\nThe CODA creation date doesn't fall within a defined Accounting Period." \
"\nPlease create the Accounting Period for date %s.") % coda_statement['date']
err_code = 'R0002'
if batch:
@ -136,7 +136,7 @@ class account_coda_import(osv.osv_memory):
('coda_creation_date', '=', coda_statement['date']),
])
if coda_id:
err_string = _("\nCODA File with Filename '%s' and Creation Date '%s' has already been imported !") \
err_string = _("\nCODA File with Filename '%s' and Creation Date '%s' has already been imported.") \
% (codafilename, coda_statement['date'])
err_code = 'W0001'
if batch:
@ -152,7 +152,7 @@ class account_coda_import(osv.osv_memory):
coda_statement['acc_number'] = line[5:17]
coda_statement['currency'] = line[18:21]
elif line[1] == '1': # foreign bank account BBAN structure
err_string = _('\nForeign bank accounts with BBAN structure are not supported !')
err_string = _('\nForeign bank accounts with BBAN structure are not supported.')
err_code = 'R1001'
if batch:
return (err_code, err_string)
@ -161,13 +161,13 @@ class account_coda_import(osv.osv_memory):
coda_statement['acc_number']=line[5:21]
coda_statement['currency'] = line[39:42]
elif line[1] == '3': # foreign bank account IBAN structure
err_string = _('\nForeign bank accounts with IBAN structure are not supported !')
err_string = _('\nForeign bank accounts with IBAN structure are not supported.')
err_code = 'R1002'
if batch:
return (err_code, err_string)
raise osv.except_osv(_('Data Error!'), err_string)
else:
err_string = _('\nUnsupported bank account structure !')
err_string = _('\nUnsupported bank account structure.')
err_code = 'R1003'
if batch:
return (err_code, err_string)
@ -189,8 +189,8 @@ class account_coda_import(osv.osv_memory):
find_bbacom = coda_bank['find_bbacom']
find_partner = coda_bank['find_partner']
else:
err_string = _("\nNo matching CODA Bank Account Configuration record found !") + \
_("\nPlease check if the 'Bank Account Number', 'Currency' and 'Account Description' fields of your configuration record match with '%s', '%s' and '%s' !") \
err_string = _("\nNo matching CODA Bank Account Configuration record found.") + \
_("\nPlease check if the 'Bank Account Number', 'Currency' and 'Account Description' fields of your configuration record match with '%s', '%s' and '%s'.") \
% (coda_statement['acc_number'], coda_statement['currency'], coda_statement['description'])
err_code = 'R1004'
if batch:
@ -265,7 +265,7 @@ class account_coda_import(osv.osv_memory):
st_line['trans_type'] = line[53]
trans_type = filter(lambda x: st_line['trans_type'] == x['type'], trans_type_table)
if not trans_type:
err_string = _('\nThe File contains an invalid CODA Transaction Type : %s!') % st_line['trans_type']
err_string = _('\nThe File contains an invalid CODA Transaction Type : %s.') % st_line['trans_type']
err_code = 'R2001'
if batch:
return (err_code, err_string)
@ -274,7 +274,7 @@ class account_coda_import(osv.osv_memory):
st_line['trans_family'] = line[54:56]
trans_family = filter(lambda x: (x['type'] == 'family') and (st_line['trans_family'] == x['code']), trans_code_table)
if not trans_family:
err_string = _('\nThe File contains an invalid CODA Transaction Family : %s!') % st_line['trans_family']
err_string = _('\nThe File contains an invalid CODA Transaction Family : %s.') % st_line['trans_family']
err_code = 'R2002'
if batch:
return (err_code, err_string)
@ -298,7 +298,7 @@ class account_coda_import(osv.osv_memory):
st_line['struct_comm_type'] = line[62:65]
comm_type = filter(lambda x: st_line['struct_comm_type'] == x['code'], comm_type_table)
if not comm_type:
err_string = _('\nThe File contains an invalid Structured Communication Type : %s!') % st_line['struct_comm_type']
err_string = _('\nThe File contains an invalid Structured Communication Type : %s.') % st_line['struct_comm_type']
err_code = 'R2003'
if batch:
return (err_code, err_string)
@ -317,7 +317,7 @@ class account_coda_import(osv.osv_memory):
elif line[1] == '2':
# movement data record 2.2
if coda_statement['coda_statement_lines'][st_line_seq]['ref'] != line[2:10]:
err_string = _('\nCODA parsing error on movement data record 2.2, seq nr %s!' \
err_string = _('\nCODA parsing error on movement data record 2.2, seq nr %s.' \
'\nPlease report this issue via your OpenERP support channel.') % line[2:10]
err_code = 'R2004'
if batch:
@ -329,7 +329,7 @@ class account_coda_import(osv.osv_memory):
elif line[1] == '3':
# movement data record 2.3
if coda_statement['coda_statement_lines'][st_line_seq]['ref'] != line[2:10]:
err_string = _('\nCODA parsing error on movement data record 2.3, seq nr %s!' \
err_string = _('\nCODA parsing error on movement data record 2.3, seq nr %s.' \
'\nPlease report this issue via your OpenERP support channel.') % line[2:10]
err_code = 'R2005'
if batch:
@ -354,7 +354,7 @@ class account_coda_import(osv.osv_memory):
st_line['counterparty_currency'] = counterparty_currency
st_line['counterparty_name'] = counterparty_name
if counterparty_currency not in [coda_bank['currency_name'], '']:
err_string = _('\nCODA parsing error on movement data record 2.3, seq nr %s!' \
err_string = _('\nCODA parsing error on movement data record 2.3, seq nr %s.' \
'\nPlease report this issue via your OpenERP support channel.') % line[2:10]
err_code = 'R2006'
if batch:
@ -386,7 +386,7 @@ class account_coda_import(osv.osv_memory):
match = True
else:
coda_parsing_note += _("\n Bank Statement '%s' line '%s':" \
"\n There is no invoice matching the Structured Communication '%s'!" \
"\n There is no invoice matching the Structured Communication '%s'." \
"\n Please verify and adjust the invoice and perform the import again or otherwise change the corresponding entry manually in the generated Bank Statement.") \
% (coda_statement['name'], st_line['ref'], reference)
# lookup partner via counterparty_number
@ -402,7 +402,7 @@ class account_coda_import(osv.osv_memory):
if not match and find_partner and bank_ids:
if len(bank_ids) > 1:
coda_parsing_note += _("\n Bank Statement '%s' line '%s':" \
"\n No partner record assigned: There are multiple partners with the same Bank Account Number '%s'!" \
"\n No partner record assigned: There are multiple partners with the same Bank Account Number '%s'." \
"\n Please correct the configuration and perform the import again or otherwise change the corresponding entry manually in the generated Bank Statement.") \
% (coda_statement['name'], st_line['ref'], counterparty_number)
else:
@ -418,13 +418,13 @@ class account_coda_import(osv.osv_memory):
elif not match and find_partner:
if counterparty_number:
coda_parsing_note += _("\n Bank Statement '%s' line '%s':" \
"\n The bank account '%s' is not defined for the partner '%s'!" \
"\n The bank account '%s' is not defined for the partner '%s'." \
"\n Please correct the configuration and perform the import again or otherwise change the corresponding entry manually in the generated Bank Statement.") \
% (coda_statement['name'], st_line['ref'],
counterparty_number, counterparty_name)
else:
coda_parsing_note += _("\n Bank Statement '%s' line '%s':" \
"\n No matching partner record found!" \
"\n No matching partner record found." \
"\n Please adjust the corresponding entry manually in the generated Bank Statement.") \
% (coda_statement['name'], st_line['ref'])
st_line['account_id'] = awaiting_acc
@ -433,7 +433,7 @@ class account_coda_import(osv.osv_memory):
coda_statement['coda_statement_lines'] = coda_statement_lines
else:
# movement data record 2.x (x <> 1,2,3)
err_string = _('\nMovement data records of type 2.%s are not supported !') % line[1]
err_string = _('\nMovement data records of type 2.%s are not supported.') % line[1]
err_code = 'R2007'
if batch:
return (err_code, err_string)
@ -466,7 +466,7 @@ class account_coda_import(osv.osv_memory):
info_line['trans_family'] = line[32:34]
trans_family = filter(lambda x: (x['type'] == 'family') and (info_line['trans_family'] == x['code']), trans_code_table)
if not trans_family:
err_string = _('\nThe File contains an invalid CODA Transaction Family : %s!') % st_line['trans_family']
err_string = _('\nThe File contains an invalid CODA Transaction Family : %s.') % st_line['trans_family']
err_code = 'R3002'
if batch:
return (err_code, err_string)
@ -490,7 +490,7 @@ class account_coda_import(osv.osv_memory):
info_line['struct_comm_type'] = line[40:43]
comm_type = filter(lambda x: info_line['struct_comm_type'] == x['code'], comm_type_table)
if not comm_type:
err_string = _('\nThe File contains an invalid Structured Communication Type : %s!') % info_line['struct_comm_type']
err_string = _('\nThe File contains an invalid Structured Communication Type : %s.') % info_line['struct_comm_type']
err_code = 'R3003'
if batch:
return (err_code, err_string)
@ -505,7 +505,7 @@ class account_coda_import(osv.osv_memory):
elif line[1] == '2':
# information data record 3.2
if coda_statement['coda_statement_lines'][st_line_seq]['ref'] != line[2:10]:
err_string = _('\nCODA parsing error on information data record 3.2, seq nr %s!' \
err_string = _('\nCODA parsing error on information data record 3.2, seq nr %s.' \
'\nPlease report this issue via your OpenERP support channel.') % line[2:10]
err_code = 'R3004'
if batch:
@ -516,7 +516,7 @@ class account_coda_import(osv.osv_memory):
elif line[1] == '3':
# information data record 3.3
if coda_statement['coda_statement_lines'][st_line_seq]['ref'] != line[2:10]:
err_string = _('\nCODA parsing error on information data record 3.3, seq nr %s!' \
err_string = _('\nCODA parsing error on information data record 3.3, seq nr %s.' \
'\nPlease report this issue via your OpenERP support channel.') % line[2:10]
err_code = 'R3005'
if batch:
@ -585,7 +585,7 @@ class account_coda_import(osv.osv_memory):
err_code = 'G0001'
if batch:
return (err_code, err_string)
raise osv.except_osv(_('CODA Import failed !'), err_string)
raise osv.except_osv(_('CODA Import failed.'), err_string)
nb_err = 0
err_string = ''
@ -627,12 +627,11 @@ class account_coda_import(osv.osv_memory):
balance_start_check = journal.default_debit_account_id.balance
else:
nb_err += 1
err_string += _('\nConfiguration Error in journal %s!' \
'\nPlease verify the Default Debit and Credit Account settings.') % journal.name
err_string += _('\nConfiguration Error!\nPlease verify the Default Debit and Credit Account settings in journal %s.') % journal.name
break
if balance_start_check <> statement['balance_start']:
nb_err += 1
err_string += _('\nThe CODA Statement %s Starting Balance (%.2f) does not correspond with the previous Closing Balance (%.2f) in journal %s!') \
err_string += _('\nThe CODA Statement %s Starting Balance (%.2f) does not correspond with the previous Closing Balance (%.2f) in journal %s.') \
% (statement['name'], statement['balance_start'], balance_start_check, journal.name)
break
@ -853,7 +852,7 @@ class account_coda_import(osv.osv_memory):
coda_st_obj.write(cr, uid, [coda_st_id], {}, context=context) # calculate balance
st_balance = coda_st_obj.read(cr, uid, coda_st_id, ['balance_end', 'balance_end_real'], context=context)
if st_balance['balance_end'] <> st_balance['balance_end_real']:
err_string += _('\nIncorrect ending Balance in CODA Statement %s for Bank Account %s!') \
err_string += _('\nIncorrect ending Balance in CODA Statement %s for Bank Account %s.') \
% (statement['coda_seq_number'], (statement['acc_number'] + ' (' + statement['currency'] + ') - ' + statement['description']))
if statement['type'] == 'normal':
nb_err += 1
@ -920,7 +919,7 @@ class account_coda_import(osv.osv_memory):
if batch:
err_code = 'G0002'
return (err_code, err_string)
raise osv.except_osv(_('CODA Import failed !'), err_string)
raise osv.except_osv(_('CODA Import failed.'), err_string)
context.update({ 'bk_st_ids': bk_st_ids})
model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'account_coda_import_result_view')], context=context)