[FIX] website_hr

bzr revid: chm@openerp.com-20130806153323-ctvf6y0yskaiwv8y
This commit is contained in:
Christophe Matthieu 2013-08-06 17:33:23 +02:00
parent bbe9721732
commit 24a790e95f
3 changed files with 7 additions and 27 deletions

View File

@ -7,6 +7,5 @@ class hr(osv.osv):
_inherit = 'hr.employee'
_columns = {
'website_published': fields.boolean('Available in the website'),
'website_published_on_contact_form': fields.boolean('Publish', help="Publish also on contact form"),
}

View File

@ -15,20 +15,4 @@ $(document).ready(function () {
}
});
});
$(document).on('click', '.js_publish_contact, .js_unpublish_contact', function (e) {
e.preventDefault();
var $link = $(this).parent();
$link.find('.js_publish_contact, .js_unpublish_contact').addClass("hidden");
var $unp = $link.find(".js_unpublish_contact");
var $p = $link.find(".js_publish_contact");
$.post('/hr/publish_contact', {'id': $link.data('id')}, function (result) {
if (+result) {
$p.addClass("hidden");
$unp.removeClass("hidden");
} else {
$p.removeClass("hidden");
$unp.addClass("hidden");
}
});
});
});

View File

@ -37,18 +37,15 @@
<a href="#" t-att-data-id="employee_id.id">
<span t-att-class="'label label-success js_unpublish %%s' %% (not employee_id.website_published and 'hidden' or '')">Click to Unpublish</span>
<span t-att-class="'label label-important js_publish %%s' %% (employee_id.website_published and 'hidden' or '')">Click to Publish</span>
</a><br/>
<a href="#" t-att-data-id="employee_id.id">
<span t-att-class="'label label-success js_unpublish_contact %%s' %% (not employee_id.website_published and 'hidden' or '')">hidden on Contacts</span>
<span t-att-class="'label label-important js_publish_contact %%s' %% (employee_id.website_published and 'hidden' or '')">display in Contacts</span>
</a>
</div>
<h5 class="media-heading"><t t-esc="employee_id.name"/></h5>
<div t-record="employee_id" t-field="department_id"> </div>
<div t-record="employee_id" t-field="job_id"> </div>
<div t-record="employee_id" t-field="work_location"> </div>
<div t-record="employee_id" t-field="work_phone"> </div>
<div t-record="employee_id" t-field="work_email"> </div>
<h5 class="media-heading" t-field="employee_id.name"/>
<div t-field="employee_id.department_id"/>
<div t-field="employee_id.job_id"/>
<div t-field="employee_id.work_location"/>
<div t-field="employee_id.work_phone"/>
<div t-field="employee_id.work_email"/>
<div t-field="employee_id.public_info"/>
</div>
</div>
</div>