'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)
@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