[useability] better error/warning message
bzr revid: fp@tinyerp.com-20110918135310-sx5wzu22opr9cdwo
This commit is contained in:
parent
99a72c7792
commit
c4047f3936
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 = {}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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']),
|
||||
]
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue