[FIX] stock,hr,pos,project,...: cleanup some calls to _( ) - only literal strings should ever been used!
bzr revid: odo@openerp.com-20101119122003-4r52xuupedyhgmcx
This commit is contained in:
parent
c4dcf78c5c
commit
e1d9d1d6c6
|
@ -113,7 +113,7 @@ This test checks the speed of the module. Note that at least 5 demo data is need
|
|||
except Exception, e:
|
||||
self.log.warning('Error in read method', exc_info=True)
|
||||
list2 = [obj, _("Error in Read method")]
|
||||
speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method:" + str(e))]
|
||||
speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method") + ": %s " % e]
|
||||
else:
|
||||
if size < 5:
|
||||
speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Warning! Not enough demo data")]
|
||||
|
|
|
@ -364,15 +364,15 @@ class hr_holidays(osv.osv):
|
|||
leave_asked = record.number_of_days_temp
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
if record.employee_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = self.pool.get('hr.holidays.status').get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
leaves_rest = obj_hr_holiday_status.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for %s while available leaves are less than asked leaves.' %(record.employee_id.name)))
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s while there are too few remaining leave days.') % (record.employee_id.name))
|
||||
nb = -(record.number_of_days_temp)
|
||||
elif record.holiday_type == 'category' and record.type == 'remove':
|
||||
if record.category_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = obj_hr_holiday_status.get_days_cat( cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for %s while available leaves are less than asked leaves.' %(record.category_id.name)))
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for category %s while there are too few remaining leave days.') % (record.category_id.name))
|
||||
nb = -(record.number_of_days_temp)
|
||||
else:
|
||||
nb = record.number_of_days_temp
|
||||
|
|
|
@ -176,7 +176,7 @@ class hr_contract(osv.osv):
|
|||
exp = line.category_id.condition
|
||||
calculate = eval(exp, obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
|
||||
|
||||
if not calculate:
|
||||
continue
|
||||
|
@ -191,7 +191,7 @@ class hr_contract(osv.osv):
|
|||
#Please have a look at the configuration guide.
|
||||
amt = eval(base, obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
|
||||
|
||||
if sal_type in ('gross', 'net'):
|
||||
if line.amount_type == 'per':
|
||||
|
@ -281,7 +281,7 @@ class hr_contract(osv.osv):
|
|||
try:
|
||||
amount = line.amount * eval(str(line.category_id.base), obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
|
||||
elif line.amount_type in ('fix', 'func'):
|
||||
amount = line.amount
|
||||
cd = line.category_id.code.lower()
|
||||
|
@ -855,7 +855,7 @@ class hr_payslip(osv.osv):
|
|||
try:
|
||||
amount = line.amount * eval(str(line.category_id.base), obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
|
||||
elif line.amount_type in ('fix', 'func'):
|
||||
amount = line.amount
|
||||
cd = line.category_id.code.lower()
|
||||
|
@ -1147,7 +1147,7 @@ class hr_payslip(osv.osv):
|
|||
exp = line.category_id.condition
|
||||
calculate = eval(exp, obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
|
||||
|
||||
if not calculate:
|
||||
continue
|
||||
|
@ -1162,7 +1162,7 @@ class hr_payslip(osv.osv):
|
|||
#Please have a look at the configuration guide.
|
||||
amt = eval(base, obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ' % (e)))
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error: %s ') % (e))
|
||||
|
||||
if sal_type in ('gross', 'net'):
|
||||
if line.amount_type == 'per':
|
||||
|
|
|
@ -49,7 +49,7 @@ class pos_open_statement(osv.osv_memory):
|
|||
for journal in journal_obj.browse(cr, uid, journal_ids, context=context):
|
||||
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], context=context)
|
||||
if len(ids):
|
||||
raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s".\nPlease close its related cash register.' %(journal.name)))
|
||||
raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s".\nPlease close its related cash register.') %(journal.name))
|
||||
|
||||
number = ''
|
||||
if journal.sequence_id:
|
||||
|
|
|
@ -330,7 +330,7 @@ class project_scrum_meeting(osv.osv):
|
|||
if meeting_id and meeting_id.sprint_id.scrum_master_id.user_email:
|
||||
res = self.email_send(cr, uid, ids, meeting_id.sprint_id.scrum_master_id.user_email)
|
||||
if not res:
|
||||
raise osv.except_osv(_('Error !'), _(' Email Not send to the scrum master %s!' % meeting_id.sprint_id.scrum_master_id.name))
|
||||
raise osv.except_osv(_('Error !'), _('Email notification could not be sent to the scrum master %s') % meeting_id.sprint_id.scrum_master_id.name)
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'), _('Please provide email address for scrum master defined on sprint.'))
|
||||
return True
|
||||
|
@ -343,7 +343,7 @@ class project_scrum_meeting(osv.osv):
|
|||
if meeting_id.sprint_id.product_owner_id.user_email:
|
||||
res = self.email_send(cr,uid,ids,meeting_id.sprint_id.product_owner_id.user_email)
|
||||
if not res:
|
||||
raise osv.except_osv(_('Error !'), _(' Email Not send to the product owner %s!' % meeting_id.sprint_id.product_owner_id.name))
|
||||
raise osv.except_osv(_('Error !'), _('Email notification could not be sent to the product owner %s') % meeting_id.sprint_id.product_owner_id.name)
|
||||
else:
|
||||
raise osv.except_osv(_('Error !'), _('Please provide email address for product owner defined on sprint.'))
|
||||
return True
|
||||
|
@ -358,7 +358,7 @@ class project_scrum_meeting(osv.osv):
|
|||
body = _('Hello ') + meeting_id.sprint_id.scrum_master_id.name + ",\n" + " \n" +_('I am sending you Daily Meeting Details of date')+ ' %s ' % (meeting_id.date)+ _('for the Sprint')+ ' %s\n' % (meeting_id.sprint_id.name)
|
||||
body += "\n"+ _('*Tasks since yesterday:')+ '\n_______________________%s' % (meeting_id.question_yesterday) + '\n' +_("*Task for Today:")+ '\n_______________________ %s\n' % (meeting_id.question_today )+ '\n' +_('*Blocks encountered:') +'\n_______________________ %s' % (meeting_id.question_blocks or _('No Blocks'))
|
||||
body += "\n\n"+_('Thank you')+",\n"+ user.name
|
||||
sub_name = meeting_id.name or _('Scrum Meeting of')+ "%s" %meeting_id.date
|
||||
sub_name = meeting_id.name or _('Scrum Meeting of %s') % meeting_id.date
|
||||
flag = tools.email_send(user_email , [email], sub_name, body, reply_to=None, openobject_id=str(meeting_id.id))
|
||||
if not flag:
|
||||
return False
|
||||
|
|
|
@ -71,7 +71,7 @@ class product_product(osv.osv):
|
|||
product_obj=self.browse(cr,uid,ids)[0]
|
||||
account_variation = product_obj.categ_id.property_stock_variation
|
||||
account_variation_id = account_variation and account_variation.id or False
|
||||
if not account_variation_id: raise osv.except_osv(_('Error!'), _('Variation Account is not specified for Product Category: %s' % (product_obj.categ_id.name)))
|
||||
if not account_variation_id: raise osv.except_osv(_('Error!'), _('Variation Account is not specified for Product Category: %s') % (product_obj.categ_id.name))
|
||||
move_ids = []
|
||||
loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
|
||||
for rec_id in ids:
|
||||
|
|
|
@ -1143,7 +1143,7 @@ class stock_picking(osv.osv):
|
|||
if move.state in ('done', 'cancel'):
|
||||
continue
|
||||
partial_data = partial_datas.get('move%s'%(move.id), False)
|
||||
assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id))
|
||||
assert partial_data, _('Missing partial picking data for move #%s') % (move.id)
|
||||
product_qty = partial_data.get('product_qty',0.0)
|
||||
move_product_qty[move.id] = product_qty
|
||||
product_uom = partial_data.get('product_uom',False)
|
||||
|
@ -2274,7 +2274,7 @@ class stock_move(osv.osv):
|
|||
if move.state in ('done', 'cancel'):
|
||||
continue
|
||||
partial_data = partial_datas.get('move%s'%(move.id), False)
|
||||
assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id))
|
||||
assert partial_data, _('Missing partial picking data for move #%s') % (move.id)
|
||||
product_qty = partial_data.get('product_qty',0.0)
|
||||
move_product_qty[move.id] = product_qty
|
||||
product_uom = partial_data.get('product_uom',False)
|
||||
|
|
Loading…
Reference in New Issue