[IMP] error messages

fix errors ending with an exclamation point; use a point instead
remove uniques (or almost) error messages titles, like 'Encoding Error' (1 occurrence in addons), 'Integrity Error' (1 occurrence in addons), 'Report Name' (1 occurrence in addons), 'Value Error' (1 occurrence in addons), 'Wrong Period Code' (1 occurrence in addons); replace these with 'Error'
add newline character after some messages titles, when necessary
fix 'UserError': should be 'User Error'
remove spaces before exclamation marks
add capital letters to messages titles words (e.g.: 'Invalid action' becomes 'Invalid Action')

bzr revid: abo@openerp.com-20120807110616-u3nlnybtgaebro18
This commit is contained in:
Antonin Bourguignon 2012-08-07 13:06:16 +02:00
parent fe5956057a
commit b0e8ae4c7d
30 changed files with 231 additions and 231 deletions

View File

@ -404,7 +404,7 @@ class account_account(osv.osv):
journal_obj = self.pool.get('account.journal')
jids = journal_obj.search(cr, uid, [('type','=','situation'),('centralisation','=',1),('company_id','=',account.company_id.id)], context=context)
if not jids:
raise osv.except_osv(_('Error!'),_("You need an Opening journal with centralisation checked to set the initial balance!"))
raise osv.except_osv(_('Error!'),_("You need an Opening journal with centralisation checked to set the initial balance."))
period_obj = self.pool.get('account.period')
pids = period_obj.search(cr, uid, [('special','=',True),('company_id','=',account.company_id.id)], context=context)
@ -426,7 +426,7 @@ class account_account(osv.osv):
}, context=context)
else:
if diff<0.0:
raise osv.except_osv(_('Error!'),_("Unable to adapt the initial balance (negative value)!"))
raise osv.except_osv(_('Error!'),_("Unable to adapt the initial balance (negative value)."))
nameinv = (name=='credit' and 'debit') or 'credit'
move_id = move_obj.create(cr, uid, {
'name': _('Opening Balance'),
@ -541,9 +541,9 @@ class account_account(osv.osv):
return True
_constraints = [
(_check_recursion, 'Error ! You cannot create recursive accounts.', ['parent_id']),
(_check_type, 'Configuration Error! \nYou cannot define children to an account with internal type different of "View"! ', ['type']),
(_check_account_type, 'Configuration Error! \nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable"! ', ['user_type','type']),
(_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id']),
(_check_type, 'Configuration Error!\nYou cannot define children to an account with internal type different of "View".', ['type']),
(_check_account_type, 'Configuration Error!\nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable".', ['user_type','type']),
]
_sql_constraints = [
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')
@ -768,7 +768,7 @@ class account_journal(osv.osv):
return True
_constraints = [
(_check_currency, 'Configuration error! The currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']),
(_check_currency, 'Configuration error!\nThe currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']),
]
def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
@ -915,7 +915,7 @@ class account_fiscalyear(osv.osv):
return True
_constraints = [
(_check_duration, 'Error! The start date of a fiscal year must precede its end date.', ['date_start','date_stop'])
(_check_duration, 'Error!\nThe start date of a fiscal year must precede its end date.', ['date_start','date_stop'])
]
def create_period3(self, cr, uid, ids, context=None):
@ -1032,8 +1032,8 @@ class account_period(osv.osv):
return True
_constraints = [
(_check_duration, 'Error ! The duration of the Period(s) is/are invalid. ', ['date_stop']),
(_check_year_limit, 'Error ! The period is invalid. Either some periods are overlapping or the period\'s dates are not matching the scope of the fiscal year.', ['date_stop'])
(_check_duration, 'Error!\nThe duration of the Period(s) is/are invalid.', ['date_stop']),
(_check_year_limit, 'Error!\nThe period is invalid. Either some periods are overlapping or the period\'s dates are not matching the scope of the fiscal year.', ['date_stop'])
]
def next(self, cr, uid, period, step, context=None):
@ -1314,7 +1314,7 @@ class account_move(osv.osv):
valid_moves = self.validate(cr, uid, ids, context)
if not valid_moves:
raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry.\nMake sure you have configured payment terms properly.\nThe latest payment term line should be of the "Balance" type.'))
raise osv.except_osv(_('Error!'), _('You cannot validate a non-balanced entry.\nMake sure you have configured payment terms properly.\nThe latest payment term line should be of the "Balance" type.'))
obj_sequence = self.pool.get('ir.sequence')
for move in self.browse(cr, uid, valid_moves, context=context):
if move.name =='/':
@ -1352,7 +1352,7 @@ class account_move(osv.osv):
top_common = top_account
elif top_account.id != top_common.id:
raise osv.except_osv(_('Error!'),
_('You cannot validate this journal entry because account "%s" does not belong to chart of accounts "%s"!') % (account.name, top_common.name))
_('You cannot validate this journal entry because account "%s" does not belong to chart of accounts "%s".') % (account.name, top_common.name))
return self.post(cursor, user, ids, context=context)
def button_cancel(self, cr, uid, ids, context=None):
@ -1474,14 +1474,14 @@ class account_move(osv.osv):
account_id = move.journal_id.default_debit_account_id.id
mode2 = 'debit'
if not account_id:
raise osv.except_osv(_('UserError'),
raise osv.except_osv(_('User Error!'),
_('There is no default debit account defined \n' \
'on journal "%s".') % move.journal_id.name)
else:
account_id = move.journal_id.default_credit_account_id.id
mode2 = 'credit'
if not account_id:
raise osv.except_osv(_('UserError'),
raise osv.except_osv(_('User Error!'),
_('There is no default credit account defined \n' \
'on journal "%s".') % move.journal_id.name)
@ -1833,7 +1833,7 @@ class account_tax_code(osv.osv):
_check_recursion = check_cycle
_constraints = [
(_check_recursion, 'Error ! You cannot create recursive accounts.', ['parent_id'])
(_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id'])
]
_order = 'code'
@ -2521,8 +2521,8 @@ class account_account_template(osv.osv):
_check_recursion = check_cycle
_constraints = [
(_check_recursion, 'Error ! You cannot create recursive account templates.', ['parent_id']),
(_check_type, 'Configuration Error!\nYou cannot define children to an account that has internal type other than "View"!', ['type']),
(_check_recursion, 'Error!\nYou cannot create recursive account templates.', ['parent_id']),
(_check_type, 'Configuration Error!\nYou cannot define children to an account that has internal type other than "View".', ['type']),
]
@ -2729,7 +2729,7 @@ class account_tax_code_template(osv.osv):
_check_recursion = check_cycle
_constraints = [
(_check_recursion, 'Error ! You cannot create recursive Tax Codes.', ['parent_id'])
(_check_recursion, 'Error!\nYou cannot create recursive Tax Codes.', ['parent_id'])
]
_order = 'code,name'
account_tax_code_template()

View File

@ -469,7 +469,7 @@ class account_bank_statement(osv.osv):
if t['state'] in ('draft'):
unlink_ids.append(t['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('In order to delete a bank statement, you must first cancel it to delete related journal items.'))
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a bank statement, you must first cancel it to delete related journal items.'))
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
return True

View File

@ -425,7 +425,7 @@ class account_invoice(osv.osv):
if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
unlink_ids.append(t['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('You cannot delete an invoice which is open or paid. You should refund it instead.'))
raise osv.except_osv(_('Invalid Action!'), _('You cannot delete an invoice which is open or paid. You should refund it instead.'))
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
return True
@ -947,7 +947,7 @@ class account_invoice(osv.osv):
journal_id = inv.journal_id.id
journal = journal_obj.browse(cr, uid, journal_id, context=ctx)
if journal.centralisation:
raise osv.except_osv(_('UserError'),
raise osv.except_osv(_('User Error!'),
_('You cannot create an invoice on a centralized journal. Uncheck the centralized counterpart box in the related journal from the configuration menu.'))
line = self.finalize_invoice_move_lines(cr, uid, inv, line)

View File

@ -1141,7 +1141,7 @@ class account_move_line(osv.osv):
if vals.get('account_tax_id', False):
raise osv.except_osv(_('Unable to change tax!'), _('You cannot change the tax, you should remove and recreate lines.'))
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
raise osv.except_osv(_('Bad account!'), _('You cannot use an inactive account.'))
raise osv.except_osv(_('Bad Account!'), _('You cannot use an inactive account.'))
if update_check:
if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals):
self._update_check(cr, uid, ids, context)
@ -1224,7 +1224,7 @@ class account_move_line(osv.osv):
if company_id:
vals['company_id'] = company_id[0]
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
raise osv.except_osv(_('Bad account!'), _('You cannot use an inactive account.'))
raise osv.except_osv(_('Bad Account!'), _('You cannot use an inactive account.'))
if 'journal_id' in vals:
context['journal_id'] = vals['journal_id']
if 'period_id' in vals:
@ -1237,7 +1237,7 @@ class account_move_line(osv.osv):
if 'period_id' not in context or not isinstance(context.get('period_id', ''), (int, long)):
period_candidate_ids = self.pool.get('account.period').name_search(cr, uid, name=context.get('period_id',''))
if len(period_candidate_ids) != 1:
raise osv.except_osv(_('Encoding error!'), _('No period found or more than one period found for the given date.'))
raise osv.except_osv(_('Error!'), _('No period found or more than one period found for the given date.'))
context['period_id'] = period_candidate_ids[0][0]
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
context['journal_id'] = context.get('search_default_journal_id')
@ -1288,7 +1288,7 @@ class account_move_line(osv.osv):
vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id,
account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0), context=ctx)
if not ok:
raise osv.except_osv(_('Bad account !'), _('You cannot use this general account in this journal, check the tab \'Entry Controls\' on the related journal.'))
raise osv.except_osv(_('Bad Account!'), _('You cannot use this general account in this journal, check the tab \'Entry Controls\' on the related journal.'))
if vals.get('analytic_account_id',False):
if journal.analytic_journal_id:

View File

@ -70,4 +70,4 @@
try:
self.button_cancel(cr, uid, [ref("account_bank_statement_0")])
except Exception, e:
assert e[0]=='UserError', 'Another exception has been raised!'
assert e[0]=='User Error!', 'Another exception has been raised!'

View File

@ -48,7 +48,7 @@ class account_period_close(osv.osv_memory):
for id in context['active_ids']:
account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', id), ('state', '=', "draft")], context=context)
if account_move_ids:
raise osv.except_osv(_('Invalid action !'), _('In order to close a period, you must first post related journal entries.'))
raise osv.except_osv(_('Invalid Action!'), _('In order to close a period, you must first post related journal entries.'))
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
cr.execute('update account_period set state=%s where id=%s', (mode, id))

View File

@ -231,7 +231,7 @@ class account_analytic_plan_instance(osv.osv):
if acct_anal_acct.search(cr, uid, [('parent_id', 'child_of', [item.root_analytic_id.id]), ('id', '=', tempo[2]['analytic_account_id'])], context=context):
total_per_plan += tempo[2]['rate']
if total_per_plan < item.min_required or total_per_plan > item.max_required:
raise osv.except_osv(_('Value Error!'),_('The total should be between %s and %s.') % (str(item.min_required), str(item.max_required)))
raise osv.except_osv(_('Error!'),_('The total should be between %s and %s.') % (str(item.min_required), str(item.max_required)))
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context=context)

View File

@ -293,10 +293,10 @@ class coda_bank_statement(osv.osv):
# unlink CODA banks statements as well as associated bank statements and CODA files
for coda_statement in self.browse(cr, uid, new_ids, context=context):
if coda_statement.statement_id.state == 'confirm':
raise osv.except_osv(_('Invalid action !'),
_("Cannot delete CODA Bank Statement '%s' of Journal '%s'." \
"\nThe associated Bank Statement has already been confirmed !" \
"\nPlease undo this action first!") \
raise osv.except_osv(_('Invalid Action!'),
_("Cannot delete CODA Bank Statement '%s' of journal '%s'." \
"\nThe associated Bank Statement has already been confirmed." \
"\nPlease undo this action first.") \
% (coda_statement.name, coda_statement.journal_id.name))
else:
if not context.get('coda_unlink', False):

View File

@ -170,7 +170,7 @@ class SendtoServer(unohelper.Base, XJobExecutor):
}
res = self.sock.execute(database, uid, self.password, 'ir.values' , 'create',rec )
else :
ErrorDialog("This name is already used for another report.\nPlease try with another name.", "", "Report Name !")
ErrorDialog("This name is already used for another report.\nPlease try with another name.", "", "Error!")
self.logobj.log_write('SendToServer',LOG_WARNING, ': report name already used DB %s' % (database))
self.win.endExecute()
except Exception,e:
@ -203,8 +203,8 @@ class SendtoServer(unohelper.Base, XJobExecutor):
self.logobj.log_write('SendToServer',LOG_INFO, ':Report %s successfully send using %s'%(params['name'],database))
self.win.endExecute()
else:
ErrorDialog("Either report name or technical name is blank.\nPlease specify an appropriate name.","","Blank Field Error !")
self.logobj.log_write('SendToServer',LOG_WARNING, ': either report name or technical name is blank.')
ErrorDialog("Either report name or technical name is empty.\nPlease specify an appropriate name.", "", "Error!")
self.logobj.log_write('SendToServer',LOG_WARNING, ': either report name or technical name is empty.')
self.win.endExecute()
def getID(self):

View File

@ -176,7 +176,7 @@ class hr_sign_in_out(osv.osv_memory):
try:
self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_out')
except:
raise osv.except_osv(_('UserError !'), _('A sign-out must be right after a sign-in!'))
raise osv.except_osv(_('User Error!'), _('A sign-out must be right after a sign-in.'))
return {'type': 'ir.actions.act_window_close'} # To do: Return Success message
hr_sign_in_out()

View File

@ -74,7 +74,7 @@ class hr_so_project(osv.osv_memory):
res = timesheet_obj.default_get(cr, uid, ['product_id','product_uom_id'], context=context)
if not res['product_uom_id']:
raise osv.except_osv(_('UserError !'), _('Please define cost unit for this employee!'))
raise osv.except_osv(_('User Error!'), _('Please define cost unit for this employee.'))
up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour,False, res['product_uom_id'])['value']
res['name'] = data['info']
@ -129,7 +129,7 @@ class hr_si_project(osv.osv_memory):
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
if not emp_id:
raise osv.except_osv(_('UserError !'), _('Please define employee for your user!'))
raise osv.except_osv(_('User Error!'), _('Please define employee for your user.'))
return False
def check_state(self, cr, uid, ids, context=None):

View File

@ -234,33 +234,33 @@ class hr_timesheet_sheet(osv.osv):
ids_signout = self.pool.get('hr.attendance').search(cr,uid,[('sheet_id', '=', sheet_id),('action','=','sign_out')])
if len(ids_signin) != len(ids_signout):
raise osv.except_osv(('Warning !'),_('The timesheet cannot be validated as it does not contain an equal number of sign ins and sign outs!'))
raise osv.except_osv(('Warning!'),_('The timesheet cannot be validated as it does not contain an equal number of sign ins and sign outs.'))
return True
def copy(self, cr, uid, ids, *args, **argv):
raise osv.except_osv(_('Error !'), _('You cannot duplicate a timesheet!'))
raise osv.except_osv(_('Error!'), _('You cannot duplicate a timesheet.'))
def create(self, cr, uid, vals, *args, **argv):
if 'employee_id' in vals:
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id:
raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign it to a user!'))
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'!'))
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'.'))
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal, like \'Timesheet\'!'))
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal, like \'Timesheet\'.'))
return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv)
def write(self, cr, uid, ids, vals, *args, **argv):
if 'employee_id' in vals:
new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id.id or False
if not new_user_id:
raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign it to a user!'))
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id):
raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlaps!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must link the employee to a product!'))
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product.'))
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal!'))
raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal.'))
return super(hr_timesheet_sheet, self).write(cr, uid, ids, vals, *args, **argv)
def button_confirm(self, cr, uid, ids, context=None):
@ -271,7 +271,7 @@ class hr_timesheet_sheet(osv.osv):
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
else:
raise osv.except_osv(_('Warning !'), _('Please verify that the total difference of the sheet is lower than %.2f!') %(di,))
raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
return True
def date_today(self, cr, uid, ids, context=None):
@ -452,9 +452,9 @@ class hr_timesheet_sheet(osv.osv):
sheets = self.read(cr, uid, ids, ['state','total_attendance'], context=context)
for sheet in sheets:
if sheet['state'] in ('confirm', 'done'):
raise osv.except_osv(_('Invalid action !'), _('You cannot delete a timesheet which is already confirmed!'))
raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a timesheet which is already confirmed.'))
elif sheet['total_attendance'] <> 0.00:
raise osv.except_osv(_('Invalid action !'), _('You cannot delete a timesheet which have attendance entries!'))
raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a timesheet which have attendance entries.'))
return super(hr_timesheet_sheet, self).unlink(cr, uid, ids, context=context)
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
@ -545,7 +545,7 @@ class hr_timesheet_line(osv.osv):
def _check(self, cr, uid, ids):
for att in self.browse(cr, uid, ids):
if att.sheet_id and att.sheet_id.state not in ('draft', 'new'):
raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !'))
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
return True
hr_timesheet_line()
@ -612,12 +612,12 @@ class hr_attendance(osv.osv):
if 'sheet_id' in context:
ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context)
if ts.state not in ('draft', 'new'):
raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet!'))
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.'))
res = super(hr_attendance,self).create(cr, uid, vals, context=context)
if 'sheet_id' in context:
if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id:
raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \
'date outside the current timesheet dates!'))
'date outside the current timesheet dates.'))
return res
def unlink(self, cr, uid, ids, *args, **kwargs):
@ -637,13 +637,13 @@ class hr_attendance(osv.osv):
for attendance in self.browse(cr, uid, ids, context=context):
if context['sheet_id'] != attendance.sheet_id.id:
raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \
'date outside the current timesheet dates!'))
'date outside the current timesheet dates.'))
return res
def _check(self, cr, uid, ids):
for att in self.browse(cr, uid, ids):
if att.sheet_id and att.sheet_id.state not in ('draft', 'new'):
raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet!'))
raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet'))
return True
hr_attendance()

View File

@ -135,22 +135,22 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse):
for invoice in invoice_obj.browse(cursor, self.uid, ids):
invoice_name = "%s %s" %(invoice.name, invoice.number)
if not invoice.partner_bank_id:
raise except_osv(_('UserError'),
_('No bank specified on invoice:\n%s' %(invoice_name)))
raise except_osv(_('User Error!'),
_('No bank specified on invoice:\n%s.' %(invoice_name)))
if not self._compile_check_bvr.match(
invoice.partner_bank_id.post_number or ''):
raise except_osv(_('UserError'),
raise except_osv(_('User Error!'),
_(('Your bank BVR number should be of the form 0X-XXX-X! '
'Please check your company '
'information for the invoice:\n%s')
'information for the invoice:\n%s.')
%(invoice_name)))
if invoice.partner_bank_id.bvr_adherent_num \
and not self._compile_check_bvr_add_num.match(
invoice.partner_bank_id.bvr_adherent_num):
raise except_osv(_('UserError'),
raise except_osv(_('User Error!'),
_(('Your bank BVR adherent number must contain only '
'digits!\nPlease check your company '
'information for the invoice:\n%s') %(invoice_name)))
'information for the invoice:\n%s.') %(invoice_name)))
return ''
def mako_template(text):
@ -183,12 +183,12 @@ class BVRWebKitParser(webkit_report.WebKitParser):
if not template and report_xml.report_webkit_data :
template = report_xml.report_webkit_data
if not template :
raise except_osv(_('Error'),_('Webkit Report template not found !'))
raise except_osv(_('Error!'),_('Webkit Report template not found.'))
header = report_xml.webkit_header.html
footer = report_xml.webkit_header.footer_html
if not header and report_xml.header:
raise except_osv(
_('No header defined for this Webkit report!'),
_('No header defined for this Webkit report.'),
_('Please set a header in company settings.')
)
if not report_xml.header :

View File

@ -72,8 +72,8 @@ def _import(self, cursor, user, data, context=None):
property_obj = self.pool.get('ir.property')
file = data['form']['file']
if not file:
raise osv.except_osv(_('UserError'),
_('Please select a file first!'))
raise osv.except_osv(_('User Error!'),
_('Please select a file first.'))
statement_id = data['id']
records = []
total_amount = 0
@ -90,12 +90,12 @@ def _import(self, cursor, user, data, context=None):
if line[0:3] in ('999', '995'):
if find_total:
raise osv.except_osv(_('Error'),
_('Too much total record found!'))
raise osv.except_osv(_('Error!'),
_('Too much total record found.'))
find_total = True
if lines:
raise osv.except_osv(_('Error'),
_('Record found after total record!'))
raise osv.except_osv(_('Error!'),
_('Record found after total record.'))
amount = float(line[39:49]) + (float(line[49:51]) / 100)
cost = float(line[69:76]) + (float(line[76:78]) / 100)
if line[2] == '5':
@ -104,11 +104,11 @@ def _import(self, cursor, user, data, context=None):
if round(amount - total_amount, 2) >= 0.01 \
or round(cost - total_cost, 2) >= 0.01:
raise osv.except_osv(_('Error'),
_('Total record different from the computed!'))
raise osv.except_osv(_('Error!'),
_('Total record different from the computed.'))
if int(line[51:63]) != len(records):
raise osv.except_osv(_('Error'),
_('Number record different from the computed!'))
raise osv.except_osv(_('Error!'),
_('Number record different from the computed.'))
else:
record = {
'reference': line[12:39],
@ -119,8 +119,8 @@ def _import(self, cursor, user, data, context=None):
}
if record['reference'] != mod10r(record['reference'][:-1]):
raise osv.except_osv(_('Error'),
_('Recursive mod10 is invalid for reference: %s') % \
raise osv.except_osv(_('Error!'),
_('Recursive mod10 is invalid for reference: %s.') % \
record['reference'])
if line[2] == '5':
@ -221,10 +221,10 @@ def _import(self, cursor, user, data, context=None):
if value :
account_id = int(value.split(',')[1])
else :
raise osv.except_osv(_('Error'),
raise osv.except_osv(_('Error!'),
_('The properties account payable and account receivable are not set.'))
if not account_id and line_ids:
raise osv.except_osv(_('Error'),
raise osv.except_osv(_('Error!'),
_('The properties account payable and account receivable are not set.'))
values['account_id'] = account_id
values['partner_id'] = partner_id

View File

@ -530,7 +530,7 @@ class mrp_production(osv.osv):
def unlink(self, cr, uid, ids, context=None):
for production in self.browse(cr, uid, ids, context=context):
if production.state not in ('draft', 'cancel'):
raise osv.except_osv(_('Invalid action !'), _('Cannot delete a manufacturing order in state \'%s\'.') % production.state)
raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a manufacturing order in state \'%s\'.') % production.state)
return super(mrp_production, self).unlink(cr, uid, ids, context=context)
def copy(self, cr, uid, id, default=None, context=None):

View File

@ -135,8 +135,8 @@ class procurement_order(osv.osv):
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
raise osv.except_osv(_('Invalid action !'),
_('Cannot delete Procurement Order(s) which are in %s state!') % \
raise osv.except_osv(_('Invalid Action!'),
_('Cannot delete Procurement Order(s) which are in %s state.') % \
s['state'])
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
@ -328,7 +328,7 @@ class procurement_order(osv.osv):
for procurement in self.browse(cr, uid, ids, context=context):
if procurement.product_qty <= 0.00:
raise osv.except_osv(_('Insufficient Data!'),
_('Please check the quantity in procurement order(s), it should not be 0 or less.'))
_('Quantity in procurement order(s) must be greater than 0.'))
if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id:
source = procurement.location_id.id

View File

@ -254,7 +254,7 @@ class res_partner(osv.osv):
def unlink(self, cursor, user, ids, context=None):
parnter_id=self.pool.get('project.project').search(cursor, user, [('partner_id', 'in', ids)])
if parnter_id:
raise osv.except_osv(_('Invalid action !'), _('You cannot delete a partner which is assigned to project, we suggest you to uncheck the active box!'))
raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a partner which is assigned to project, but you can uncheck the active box.'))
return super(res_partner,self).unlink(cursor, user, ids,
context=context)
res_partner()

View File

@ -238,7 +238,7 @@ class purchase_order(osv.osv):
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('In order to delete a purchase order, You must cancel it first.'))
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.'))
# TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
# automatically sending subflow.delete upon deletion

View File

@ -295,7 +295,7 @@ class sale_order(osv.osv):
if s['state'] in ['draft', 'cancel']:
unlink_ids.append(s['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('In order to delete a confirmed sales order, you must cancel it! To cancel a sale order, you must first cancel related picking for delivery orders.'))
raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it.\nTo do so, you must first cancel related picking for delivery orders.'))
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
@ -1249,7 +1249,7 @@ class sale_order_line(osv.osv):
def button_cancel(self, cr, uid, ids, context=None):
for line in self.browse(cr, uid, ids, context=context):
if line.invoiced:
raise osv.except_osv(_('Invalid action !'), _('You cannot cancel a sale order line that has already been invoiced!'))
raise osv.except_osv(_('Invalid Action!'), _('You cannot cancel a sale order line that has already been invoiced.'))
for move_line in line.move_ids:
if move_line.state != 'cancel':
raise osv.except_osv(
@ -1479,7 +1479,7 @@ class sale_order_line(osv.osv):
"""Allows to delete sales order lines in draft,cancel states"""
for rec in self.browse(cr, uid, ids, context=context):
if rec.state not in ['draft', 'cancel']:
raise osv.except_osv(_('Invalid action !'), _('Cannot delete a sales order line which is in state \'%s\'!') %(rec.state,))
raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a sales order line which is in state \'%s\'.') %(rec.state,))
return super(sale_order_line, self).unlink(cr, uid, ids, context=context)
sale_order_line()

View File

@ -119,7 +119,7 @@ class sale_advance_payment_inv(osv.osv_memory):
res['account_id'] = account_id
if not res.get('account_id'):
raise osv.except_osv(_('Configuration Error!'),
_('There is no income account defined for this product: "%s" (id:%d)') % \
_('There is no income account defined for this product: "%s" (id:%d).') % \
(wizard.product_id.name, wizard.product_id.id,))
# determine invoice amount

View File

@ -143,7 +143,7 @@ class stock_sale_forecast(osv.osv):
if t['state'] in ('draft'):
unlink_ids.append(t['id'])
else:
raise osv.except_osv(_('Invalid action !'), _('Cannot delete a validated sales forecast!'))
raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a validated sales forecast.'))
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
return True
@ -623,7 +623,7 @@ class stock_planning(osv.osv):
def procure_incomming_left(self, cr, uid, ids, context, *args):
for obj in self.browse(cr, uid, ids, context=context):
if obj.incoming_left <= 0:
raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !'))
raise osv.except_osv(_('Error!'), _('Incoming Left must be greater than 0.'))
uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
proc_id = self.pool.get('procurement.order').create(cr, uid, {
@ -667,11 +667,11 @@ class stock_planning(osv.osv):
def internal_supply(self, cr, uid, ids, context, *args):
for obj in self.browse(cr, uid, ids, context=context):
if obj.incoming_left <= 0:
raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !'))
raise osv.except_osv(_('Error!'), _('Incoming Left must be greater than 0.'))
if not obj.supply_warehouse_id:
raise osv.except_osv(_('Error !'), _('You must specify a Source Warehouse !'))
raise osv.except_osv(_('Error!'), _('You must specify a Source Warehouse.'))
if obj.supply_warehouse_id.id == obj.warehouse_id.id:
raise osv.except_osv(_('Error !'), _('You must specify a Source Warehouse different than calculated (destination) Warehouse !'))
raise osv.except_osv(_('Error!'), _('You must specify a Source Warehouse different than calculated (destination) Warehouse.'))
uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context)
user = self.pool.get('res.users').browse(cr, uid, uid, context)
picking_id = self.pool.get('stock.picking').create(cr, uid, {