[iMP] Order of published/unpublished documents
bzr revid: fp@openerp.com-20131116095301-3zp01vsx821odqhx
This commit is contained in:
parent
46a967502d
commit
943ba00984
|
@ -146,6 +146,9 @@ class BlogPost(osv.Model):
|
|||
select=True, readonly=True,
|
||||
),
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': False
|
||||
}
|
||||
|
||||
def create_history(self, cr, uid, ids, vals, context=None):
|
||||
for i in ids:
|
||||
|
|
|
@ -9,6 +9,9 @@ class hr(osv.osv):
|
|||
'website_published': fields.boolean('Available in the website'),
|
||||
'public_info': fields.text('Public Info'),
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': False
|
||||
}
|
||||
|
||||
def img(self, cr, uid, ids, field='image_small', context=None):
|
||||
return "/website/image?model=%s&field=%s&id=%s" % (self._name, field, ids[0])
|
||||
|
|
|
@ -14,7 +14,7 @@ class website_hr_recruitment(http.Controller):
|
|||
def jobs(self, department=None, office=None, page=0):
|
||||
hr_job_obj = request.registry['hr.job']
|
||||
domain = []
|
||||
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, order="website_published,no_of_recruitment", context=request.context)
|
||||
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, order="website_published desc,no_of_recruitment", context=request.context)
|
||||
jobs = hr_job_obj.browse(request.cr, request.uid, jobpost_ids, request.context)
|
||||
|
||||
departments = set()
|
||||
|
|
|
@ -9,4 +9,7 @@ class hr_job(osv.osv):
|
|||
_columns = {
|
||||
'website_published': fields.boolean('Available in the website'),
|
||||
'website_description': fields.html('Description for the website'),
|
||||
}
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': False
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ from openerp.osv import osv, fields
|
|||
|
||||
class WebsiteResCompany(osv.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
_columns = {
|
||||
'website_published': fields.related('partner_id', 'website_published', string='Publish', help="Publish on the website"),
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@ class WebsiteResPartner(osv.Model):
|
|||
'Website artner Short Description'
|
||||
),
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': False
|
||||
}
|
||||
|
||||
def img(self, cr, uid, ids, field='image_small', context=None):
|
||||
return "/website/image?model=%s&field=%s&id=%s" % (self._name, field, ids[0])
|
||||
|
|
Loading…
Reference in New Issue