[FIX] website.hr.recruitment, website res.company: access right, add a constraint with address_id (must be published) on hr.recruitment and add a related field website_published on res.company
bzr revid: chm@openerp.com-20131112104509-0n266eias5oc55gb
This commit is contained in:
parent
5b0e0a343b
commit
3275dcf32a
|
@ -10,3 +10,12 @@ class hr_job(osv.osv):
|
||||||
'website_published': fields.boolean('Available in the website'),
|
'website_published': fields.boolean('Available in the website'),
|
||||||
'website_description': fields.html('Description for the website'),
|
'website_description': fields.html('Description for the website'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_address_id_published, "This Jobpost can't be published if the field Job Location is not website published.", ['address_id','website_published']),
|
||||||
|
]
|
|
@ -31,6 +31,7 @@
|
||||||
'views/res_partner_view.xml',
|
'views/res_partner_view.xml',
|
||||||
'views/website_partner_view.xml',
|
'views/website_partner_view.xml',
|
||||||
'security/website_partner_security.xml',
|
'security/website_partner_security.xml',
|
||||||
|
'data/website_data.xml',
|
||||||
],
|
],
|
||||||
'css': [
|
'css': [
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
<record id="base.main_company" model="res.company">
|
||||||
|
<field name="website_published">True</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</openerp>
|
|
@ -1 +1,2 @@
|
||||||
import res_partner
|
import res_partner
|
||||||
|
import res_company
|
|
@ -0,0 +1,11 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
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"),
|
||||||
|
}
|
Loading…
Reference in New Issue