[IMP] You do not need to recruit at least 1 person to launch recruitment offers

bzr revid: fp@tinyerp.com-20131113082322-gk4ix80wr6is1wpw
This commit is contained in:
Fabien Pinckaers
2013-11-13 09:23:22 +01:00
parent 465aaf6bbc
commit 25fa9a9ba5
2 changed files with 14 additions and 27 deletions
+14 -14
View File
@@ -51,20 +51,20 @@ class event(osv.osv):
'website_published': False,
}
def _check_organizer_id_published(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.website_published and obj.organizer_id and not obj.organizer_id.website_published:
return False
return True
def _check_address_id_published(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.website_published and obj.address_id and not obj.address_id.website_published:
return False
return True
_constraints = [
(_check_organizer_id_published, "This event can't be published if the field Orginizer is not website published.", ['organizer_id','website_published']),
(_check_address_id_published, "This event can't be published if the field Location is not website published.", ['address_id','website_published']),
]
# def _check_organizer_id_published(self, cr, uid, ids, context=None):
# for obj in self.browse(cr, uid, ids, context=context):
# if obj.website_published and obj.organizer_id and not obj.organizer_id.website_published:
# return False
# return True
# def _check_address_id_published(self, cr, uid, ids, context=None):
# for obj in self.browse(cr, uid, ids, context=context):
# if obj.website_published and obj.address_id and not obj.address_id.website_published:
# return False
# return True
# _constraints = [
# (_check_organizer_id_published, "This event can't be published if the field Orginizer is not website published.", ['organizer_id','website_published']),
# (_check_address_id_published, "This event can't be published if the field Location is not website published.", ['address_id','website_published']),
# ]
def google_map_img(self, cr, uid, ids, zoom=8, width=298, height=298, context=None):
partner = self.browse(cr, uid, ids[0], context=context)
@@ -91,17 +91,4 @@ class website_hr_recruitment(http.Controller):
@website.route('/job/publish', type='json', auth="admin", multilang=True)
def publish (self, id, object):
res = controllers.publish(id, object)
hr_job = request.registry[object]
id = int(id)
rec = hr_job.browse(request.cr, request.uid, id)
vals = {}
if rec.website_published:
vals['state'] = 'recruit'
if not rec.no_of_recruitment:
vals ['no_of_recruitment'] = 1.0
else:
vals['state'] = 'open'
hr_job.write(request.cr, request.uid, [rec.id], vals, context=request.context)
return res