[IMP] add sub-type to follow in progress phase,improved form view,improved kanban view, improved css
bzr revid: tpa@tinyerp.com-20130619093203-oxkl3awv6kr65v01
This commit is contained in:
parent
e2c343fc63
commit
128f012c9b
|
@ -95,6 +95,11 @@ class hr_job(osv.osv):
|
|||
_name = "hr.job"
|
||||
_description = "Job Position"
|
||||
_inherit = ['mail.thread','ir.needaction_mixin']
|
||||
_track = {
|
||||
'state': {
|
||||
'hr.mt_job_recruit': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'recruit',
|
||||
},
|
||||
}
|
||||
_columns = {
|
||||
'name': fields.char('Job Name', size=128, required=True, select=True),
|
||||
# TO CLEAN: when doing a cleaning, we should change like this:
|
||||
|
@ -141,8 +146,8 @@ class hr_job(osv.osv):
|
|||
context = {}
|
||||
return {'value': {'expected_employees': no_of_recruitment + no_of_employee}}
|
||||
|
||||
def action_hired_employee(self, cr, uid, id, value, context=None):
|
||||
return self.write(cr, uid, [id], {'no_of_hired_employee': value}, context=context)
|
||||
def action_employee_to_hire(self, cr, uid, id, value, context=None):
|
||||
return self.write(cr, uid, [id], {'no_of_recruitment': value}, context=context)
|
||||
|
||||
def job_recruitment(self, cr, uid, ids, *args):
|
||||
for job in self.browse(cr, uid, ids):
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -343,31 +343,29 @@
|
|||
<field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name" class="oe_inline"/></h1>
|
||||
<label for="department_id" class="oe_edit_only"/>
|
||||
<h2><field name="department_id" class="oe_inline"/></h2>
|
||||
</div>
|
||||
<div class="oe_right oe_button_box" name="buttons"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="no_of_employee" groups="base.group_user"/>
|
||||
<field name="no_of_recruitment" on_change="on_change_expected_employee(no_of_recruitment,no_of_employee)"/>
|
||||
<field name="no_of_hired_employee" attrs="{'invisible':[('state','=','open')]}"/>
|
||||
<field name="expected_employees" groups="base.group_user"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<label string="Job Name and Department" class="oe_edit_only" colspan="4"/>
|
||||
<h1><field name="name" class="oe_inline" nolabel="1" colspan="2"/>(<field name="department_id" class="oe_inline" nolabel="1" colspan="2"/>)</h1>
|
||||
<group colspan="4">
|
||||
<group>
|
||||
<field name="no_of_employee" groups="base.group_user"/>
|
||||
<field name="no_of_recruitment" on_change="on_change_expected_employee(no_of_recruitment,no_of_employee)"/>
|
||||
<field name="expected_employees" groups="base.group_user"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
<div colspan="4">
|
||||
<label for="description"/>
|
||||
<field name="description"/>
|
||||
</div>
|
||||
<div colspan="4">
|
||||
<label for="requirements"/>
|
||||
<field name="requirements"/>
|
||||
</div>
|
||||
</group>
|
||||
<div>
|
||||
<label for="description"/>
|
||||
<field name="description"/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="requirements"/>
|
||||
<field name="requirements"/>
|
||||
</div>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
|
|
|
@ -429,7 +429,7 @@ class hr_applicant(base_stage, osv.Model):
|
|||
address_id = self.pool.get('res.partner').address_get(cr,uid,[applicant.partner_id.id],['contact'])['contact']
|
||||
contact_name = self.pool.get('res.partner').name_get(cr,uid,[applicant.partner_id.id])[0][1]
|
||||
if applicant.job_id and (applicant.partner_name or contact_name):
|
||||
applicant.job_id.write({'no_of_recruitment': applicant.job_id.no_of_recruitment - 1})
|
||||
applicant.job_id.write({'no_of_hired_employee': applicant.job_id.no_of_hired_employee + 1})
|
||||
emp_id = hr_employee.create(cr,uid,{'name': applicant.partner_name or contact_name,
|
||||
'job_id': applicant.job_id.id,
|
||||
'address_home_id': address_id,
|
||||
|
|
|
@ -303,10 +303,10 @@
|
|||
<!-- HR Job -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_hr_job_applications">
|
||||
<field name="name">Applications</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="view_mode">kanban,tree,form,graph,calendar</field>
|
||||
<field name="context">{'search_default_job_id': [active_id], 'default_job_id': active_id}</field>
|
||||
<field name="name">Applications</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="view_mode">kanban,tree,form,graph,calendar</field>
|
||||
<field name="context">{'search_default_job_id': [active_id], 'default_job_id': active_id}</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_job_survey" model="ir.ui.view">
|
||||
|
@ -318,26 +318,22 @@
|
|||
<label for="survey_id" groups="base.group_user"/>
|
||||
<div groups="base.group_user">
|
||||
<field name="survey_id" class="oe_inline" domain="[('type','=','Human Resources')]"/>
|
||||
<button class="oe_inline oe_link"
|
||||
string="Interview"
|
||||
icon="gtk-go-forward"
|
||||
name="action_print_survey" type="object"
|
||||
attrs="{'invisible':[('survey_id','=',False)]}"/>
|
||||
</div>
|
||||
</field>
|
||||
<xpath expr="//div[@class='oe_title']//h2" position="after">
|
||||
<div name="group_alias"
|
||||
attrs="{'invisible': [('alias_domain', '=', False)]}">
|
||||
<label for="alias_id" string="Email Alias"/>
|
||||
<field name="alias_id" class="oe_inline oe_read_only" required="0" nolabel="1"/>
|
||||
<field name="company_id" position="after">
|
||||
<div name="group_alias" attrs="{'invisible': [('alias_domain', '=', False)]}" col="8" colspan="8">
|
||||
<label for="alias_id" string="Email Alias" colspan="2"/>
|
||||
<field name="alias_id" class="oe_inline oe_read_only" required="0" nolabel="1" colspan="2"/>
|
||||
<span name="edit_alias" class="oe_edit_only">
|
||||
<field name="alias_name" class="oe_inline"
|
||||
attrs="{'required': [('alias_id', '!=', False)]}"/>
|
||||
@
|
||||
<field name="alias_domain" class="oe_inline" readonly="1"/>
|
||||
<field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}" colspan="2"/> @
|
||||
<field name="alias_domain" class="oe_inline" readonly="1" colspan="2"/>
|
||||
</span>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
<div name="buttons" position="inside">
|
||||
<button string="Applications" name="%(action_hr_job_applications)d" type="action"/>
|
||||
<button string="Interview" name="action_print_survey" type="object" attrs="{'invisible':[('survey_id','=',False)]}"/>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -372,22 +368,34 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class = "oe_kanban_content">
|
||||
<div class="oe_job oe_name oe_kanban_ellipsis">
|
||||
<field name="name"/>
|
||||
<t t-if="record.manager_id.raw_value">
|
||||
<img t-att-src="kanban_image('hr.employee', 'image_medium', record.manager_id.raw_value[0])" class="oe_kanban_avatar oe_job_avatar"/>
|
||||
</t>
|
||||
<t t-if="record.manager_id.raw_value === false">
|
||||
<img t-att-src='_s + "/base/static/src/img/avatar.png"' class="oe_kanban_avatar oe_job_avatar"/>
|
||||
</t>
|
||||
<div class="oe_job_detail">
|
||||
<div class="oe_job oe_name oe_kanban_ellipsis">
|
||||
<field name="name"/>
|
||||
</div>
|
||||
<div class="oe_job_alias oe_kanban_ellipsis" t-if=" record.alias_id.value">
|
||||
<span class="oe_e">%%</span><small><field name="alias_id"/></small>
|
||||
</div>
|
||||
<div class="oe_job oe_kanban_ellipsis">
|
||||
<field name="department_id"/>
|
||||
</div>
|
||||
<div class="oe_job oe_manager_name oe_kanban_ellipsis">
|
||||
<t t-esc="record.manager_id.value"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_job oe_kanban_ellipsis">
|
||||
<field name="department_id"/>
|
||||
</div>
|
||||
<div class="oe_job oe_manager_name">
|
||||
<t t-esc="record.manager_id.value"/>
|
||||
</div>
|
||||
<img t-att-src="kanban_image('hr.employee', 'image', record.manager_id.raw_value, {'preview_image': 'image_small'})" t-att-title="record.manager_id.value.name" class="oe_kanban_avatar oe_job_avatar"/>
|
||||
<t t-if="record.state.raw_value == 'recruit'">
|
||||
<div class="oe_applications">
|
||||
<a name="%(action_hr_job_applications)d" type="action" t-if="record.application_count.value gt 1" class="oe_link"><t t-esc="record.application_count.value"/> Applications</a>
|
||||
<a name="%(action_hr_job_applications)d" type="action" t-if="record.application_count.value lt 2" class="oe_link"><t t-esc="record.application_count.value"/> Application</a>
|
||||
<a name="%(action_hr_job_applications)d" type="action">
|
||||
<span t-if="record.application_count.value gt 1"><field name="application_count"/> Applications</span>
|
||||
<span t-if="record.application_count.value lt 2"><field name="application_count"/> Application</span>
|
||||
</a>
|
||||
</div>
|
||||
<field state="recruit" name="no_of_recruitment" widget="justgage" options="{'min_field': 'no_of_hired_employee','max_field': 'no_of_recruitment', 'label_field': 'no_of_hired_employee', 'action_change': 'action_hired_employee'}">Forecast</field>
|
||||
<field state="recruit" name="no_of_recruitment" widget="justgage" options="{'label_field': 'no_of_hired_employee', 'action_change': 'action_employee_to_hire'}">Forecast</field>
|
||||
</t>
|
||||
<t t-if="record.state.raw_value == 'open'">
|
||||
<div class="oe_start_recruitment">
|
||||
|
|
|
@ -1,23 +1,35 @@
|
|||
.openerp .oe_kanban_job{
|
||||
width: 355px;
|
||||
min-height: 145px !important;
|
||||
min-height: 150px !important;
|
||||
}
|
||||
.openerp .oe_custom{
|
||||
z-index:2;
|
||||
.openerp .oe_job_alias{
|
||||
margin: 3px 85px;
|
||||
width: 270px;
|
||||
}
|
||||
.openerp .oe_job_detail{
|
||||
height: 70px;
|
||||
}
|
||||
.openerp .oe_job_alias .oe_e {
|
||||
font-size: 30px;
|
||||
line-height: 6px;
|
||||
vertical-align: top;
|
||||
margin-right: 3px;
|
||||
color: white;
|
||||
text-shadow: 0px 0px 2px black;
|
||||
float: left;
|
||||
}
|
||||
.openerp .oe_job {
|
||||
font-size: 112%;
|
||||
position: inline;
|
||||
margin: 3px 3px;
|
||||
margin-left: 70px;
|
||||
margin-left: 85px;
|
||||
color: #4c4c4c;
|
||||
height: 16px;
|
||||
}
|
||||
.openerp img.oe_job_avatar {
|
||||
margin-top: -40px;
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
width: 75px;
|
||||
height: 75px;
|
||||
}
|
||||
.openerp .oe_launch_recruitment{
|
||||
float: right;
|
||||
|
@ -26,24 +38,25 @@
|
|||
right: 10px;
|
||||
}
|
||||
.openerp div.oe_applications {
|
||||
margin-top: 35px;
|
||||
position: absolute;;
|
||||
margin-top: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
.openerp .oe_applications .oe_link:hover {
|
||||
.openerp .oe_applications > a > span:hover{
|
||||
margin: 4px 0;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.openerp .oe_name {
|
||||
font-size: 14px;
|
||||
}
|
||||
.openerp .oe_manager_name {
|
||||
margin-left: 70px;
|
||||
position: absolute;
|
||||
width: 135px;
|
||||
font-size: 11px;
|
||||
color: gray;
|
||||
}
|
||||
.openerp .oe_justgage {
|
||||
float: right;
|
||||
margin-top: -82px;
|
||||
margin-top: -60px;
|
||||
margin-right: -30px;
|
||||
width:200px;
|
||||
height:130px;
|
||||
|
@ -56,7 +69,7 @@
|
|||
color: #4c4c4c;
|
||||
}
|
||||
.openerp .oe_start_recruitment {
|
||||
padding-top: 30px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.openerp .oe_start_recruitment p {
|
||||
font-size: 14px;
|
||||
|
|
|
@ -39,7 +39,7 @@ openerp.hr_recruitment = function (openerp) {
|
|||
}
|
||||
if (!self.$el.find(".oe_justgage_edit").size()) {
|
||||
var $svg = self.$el.find('svg');
|
||||
$div = $('<div class="oe_justgage_edit" style="text-align: center; z-index: 1; position: absolute; width: ' + $svg.outerWidth() + 'px; top: ' + ($svg.outerHeight()/2-5) + 'px;"/>');
|
||||
$div = $('<div class="oe_justgage_edit" style="text-align: center; z-index: 1; position: absolute; width: ' + $svg.outerWidth() + 'px; top: ' + ($svg.outerHeight()/2+20) + 'px;"/>');
|
||||
$input = $('<input style="text-align: center; width: ' + ($svg.outerWidth()/2) + 'px; margin: auto;"/>').val(value);
|
||||
$div.append($input);
|
||||
self.$el.prepend($div)
|
||||
|
@ -73,5 +73,16 @@ openerp.hr_recruitment = function (openerp) {
|
|||
}
|
||||
},
|
||||
});
|
||||
openerp.web_kanban.fields_registry.add("justgage", "openerp.hr_recruitment.GaugeWidget");
|
||||
|
||||
openerp.web_kanban.KanbanRecord.include({
|
||||
on_card_clicked: function() {
|
||||
if (this.view.dataset.model === 'hr.job') {
|
||||
this.$('.oe_applications a').first().click();
|
||||
} else {
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
openerp.web_kanban.fields_registry.add("justgage", "openerp.hr_recruitment.GaugeWidget");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue