[useability] better error/warning message

bzr revid: fp@tinyerp.com-20110918135310-sx5wzu22opr9cdwo
This commit is contained in:
Fabien Pinckaers 2011-09-18 15:53:10 +02:00
parent 99a72c7792
commit c4047f3936
15 changed files with 21 additions and 22 deletions

View File

@ -207,7 +207,7 @@ class account_cash_statement(osv.osv):
]
open_jrnl = self.search(cr, uid, sql)
if open_jrnl:
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal'))
raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal!'))
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id'], context=context).type == 'cash':
open_close = self._get_cash_open_close_box_lines(cr, uid, context)

View File

@ -1232,7 +1232,7 @@ class account_move_line(osv.osv):
move_id = move_obj.create(cr, uid, v, context)
vals['move_id'] = move_id
else:
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece!\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
ok = not (journal.type_control_ids or journal.account_control_ids)
if ('account_id' in vals):
account = account_obj.browse(cr, uid, vals['account_id'], context=context)

View File

@ -58,7 +58,7 @@ class audittrail_rule(osv.osv):
}
_sql_constraints = [
('model_uniq', 'unique (object_id)', """There is a rule defined on this object\n You can not define other on the same!""")
('model_uniq', 'unique (object_id)', """There is a rule defined on this object\n You cannot define another one the same object!""")
]
__functions = {}

View File

@ -386,7 +386,7 @@ property or property parameter."),
}
def copy(self, cr, uid, id, default=None, context=None):
raise osv.except_osv(_('Warning!'), _('Can not Duplicate'))
raise osv.except_osv(_('Warning!'), _('You cannot duplicate a calendar attendee.'))
def get_ics_file(self, cr, uid, event_obj, context=None):
"""
@ -998,9 +998,9 @@ class calendar_event(osv.osv):
for datas in self.read(cr, uid, ids, ['id','byday','recurrency', 'month_list','end_date', 'rrule_type', 'select1', 'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'exrule', 'day', 'week_list' ], context=context):
event = datas['id']
if datas.get('interval', 0) < 0:
raise osv.except_osv(_('Warning!'), _('Interval can not be Negative'))
raise osv.except_osv(_('Warning!'), _('Interval cannot be negative'))
if datas.get('count', 0) < 0:
raise osv.except_osv(_('Warning!'), _('Count can not be Negative'))
raise osv.except_osv(_('Warning!'), _('Count cannot be negative'))
result[event] = self.compute_rule_string(datas)
return result

View File

@ -529,7 +529,7 @@ class report_creator(osv.osv):
_constraints = [
(_function_field, 'You can not display field which are not stored in Database.', ['field_ids']),
(_function_field, 'You can not display field which are not stored in database.', ['field_ids']),
(_aggregation_error, 'You can apply aggregate function to the non calculated field.', ['field_ids']),
(_calander_view_error, "You must have to give calendar view's color,start date and delay.", ['field_ids']),
]

View File

@ -116,7 +116,7 @@ class account_analytic_line(osv.osv):
for line in self.browse(cr, uid, select):
if line.invoice_id:
raise osv.except_osv(_('Error !'),
_('You can not modify an invoiced analytic line!'))
_('You cannot modify an invoiced analytic line!'))
return True
def copy(self, cursor, user, obj_id, default=None, context=None):

View File

@ -189,7 +189,7 @@ class hr_timesheet_sheet(osv.osv):
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!'))
if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id):
raise osv.except_osv(_('Error !'), _('You can not have 2 timesheets that overlaps!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
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!'))
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
@ -355,7 +355,7 @@ class hr_timesheet_sheet(osv.osv):
_constraints = [
(_sheet_date, 'You can not have 2 timesheets that overlaps !\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']),
(_sheet_date, 'You cannot have 2 timesheets that overlaps !\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']),
(_date_current_check, 'You must select a Current date which is in the timesheet dates !', ['date_current']),
]
@ -490,7 +490,7 @@ class hr_timesheet_line(osv.osv):
return True
_constraints = [
(_check_sheet_state, 'You can not modify an entry in a Confirmed/Done timesheet !.', ['state']),
(_check_sheet_state, 'You cannot modify an entry in a Confirmed/Done timesheet !.', ['state']),
]
def unlink(self, cr, uid, ids, *args, **kwargs):

View File

@ -64,7 +64,7 @@ class idea_category(osv.osv):
_order = 'parent_id,name asc'
_constraints = [
(osv.osv._check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
(osv.osv._check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
]
idea_category()

View File

@ -379,7 +379,7 @@ class Partner(osv.osv):
return True
_constraints = [
(_check_recursion, 'Error ! You can not create recursive associated members.', ['associate_member'])
(_check_recursion, 'Error ! You cannot create recursive associated members.', ['associate_member'])
]
def copy(self, cr, uid, id, default=None, context=None):
@ -570,4 +570,4 @@ class account_invoice_line(osv.osv):
account_invoice_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -258,7 +258,7 @@ class mrp_bom(osv.osv):
return check_bom(boms)
_constraints = [
(_check_recursion, 'Error ! You can not create recursive BoM.', ['parent_id']),
(_check_recursion, 'Error ! You cannot create recursive BoM.', ['parent_id']),
(_check_product, 'BoM line product should not be same as BoM product.', ['product_id']),
]

View File

@ -121,8 +121,7 @@ class product_uom(osv.osv):
}
_sql_constraints = [
('factor_gt_zero', 'CHECK (factor!=0)', 'The conversion ratio for a unit of measure cannot be 0!'),
('factor_category_id_uniq', 'unique (category_id, factor)', 'You can not have more than one UOM with same factor for same UOM category'),
('factor_gt_zero', 'CHECK (factor!=0)', 'The conversion ratio for a unit of measure cannot be 0!')
]
def _compute_qty(self, cr, uid, from_uom_id, qty, to_uom_id=False):
@ -230,7 +229,7 @@ class product_category(osv.osv):
return True
_constraints = [
(_check_recursion, 'Error ! You can not create recursive categories.', ['parent_id'])
(_check_recursion, 'Error ! You cannot create recursive categories.', ['parent_id'])
]
def child_get(self, cr, uid, ids):
return [ids]

View File

@ -118,7 +118,7 @@ class project(osv.osv):
def unlink(self, cr, uid, ids, *args, **kwargs):
for proj in self.browse(cr, uid, ids):
if proj.tasks:
raise osv.except_osv(_('Operation Not Permitted !'), _('You can not delete a project with tasks. I suggest you to deactivate it.'))
raise osv.except_osv(_('Operation Not Permitted !'), _('You cannot delete a project containing tasks. I suggest you to desactivate it.'))
return super(project, self).unlink(cr, uid, ids, *args, **kwargs)
_columns = {

View File

@ -228,7 +228,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 can not 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, we suggest you to uncheck the active box!'))
return super(res_partner,self).unlink(cursor, user, ids,
context=context)
res_partner()

View File

@ -289,7 +289,7 @@ class purchase_order(osv.osv):
todo = []
for po in self.browse(cr, uid, ids, context=context):
if not po.order_line:
raise osv.except_osv(_('Error !'),_('You can not confirm purchase order without Purchase Order Lines.'))
raise osv.except_osv(_('Error !'),_('You cannot confirm a purchase order without any lines.'))
for line in po.order_line:
if line.state=='draft':
todo.append(line.id)

View File

@ -2636,7 +2636,7 @@ class stock_inventory(osv.osv):
for account_move in account_move_data_l:
if account_move['state'] == 'posted':
raise osv.except_osv(_('UserError'),
_('You can not cancel inventory which has any account move with posted state.'))
_('In order to cancel this inventory, you must first unpost related journal entries.'))
account_move_obj.unlink(cr, uid, [account_move['id']], context=context)
self.write(cr, uid, [inv.id], {'state': 'cancel'}, context=context)
return True