[MERGE] Merge with trunk

bzr revid: jke@openerp.com-20140114135240-c7r0ma18f1ls2yae
This commit is contained in:
jke-openerp 2014-01-14 14:52:40 +01:00
commit 0072915549
2 changed files with 6 additions and 8 deletions

View File

@ -26,6 +26,7 @@ import math
import time
from operator import attrgetter
from openerp.exceptions import Warning
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
@ -440,11 +441,8 @@ class hr_holidays(osv.osv):
leave_days = self.pool.get('hr.holidays.status').get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, context=context)[record.holiday_status_id.id]
if leave_days['remaining_leaves'] < 0 or leave_days['virtual_remaining_leaves'] < 0:
# Raising a warning gives a more user-friendly feedback than the default constraint error
raise osv.except_osv(
_('Warning!'),
_('The number of remaining leaves is not sufficient for this leave type.\n'
'Please verify also the leaves waiting for validation.')
)
raise Warning(_('The number of remaining leaves is not sufficient for this leave type.\n'
'Please verify also the leaves waiting for validation.'))
return True
# -----------------------------

View File

@ -6,11 +6,11 @@
@license: GPL
'''
import Image
import qrcode
import time
import copy
import qrcode
from PIL import Image
try:
import jcconv
except: