[IMP] add default job alias for .jobs

bzr revid: tpa@tinyerp.com-20130528133143-q21h2ld6ehhgo975
This commit is contained in:
Turkesh Patel (Open ERP)
2013-05-28 19:01:43 +05:30
parent 1e6a6be3a4
commit 4d74d76ff2
3 changed files with 30 additions and 31 deletions
+11 -14
View File
@@ -366,19 +366,16 @@
</ul>
</div>
<div class = "oe_kanban_content">
<h3 class="oe_kanban_ellipsis"><field name="name"/></h3>
<div class="oe_kanban_alias oe_kanban_ellipsis" t-if=" record.job_alias.value">
<span class="oe_e">%%</span><small><field name="job_alias"/></small>
<div class="oe_job oe_name oe_kanban_ellipsis">
<field name="name"/>
</div>
<div class="oe_department">
<div class="oe_job oe_kanban_ellipsis">
<field name="department_id"/>
</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"/>
<div class="oe_name">
<t t-esc="record.manager_id.value"/>
</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"/>
<t t-if="record.state.raw_value == 'recruit'">
<div class="oe_applications">
<a name="%(hr_job_applications)d" type="action" >
@@ -387,14 +384,14 @@
</a>
</div>
<div class="oe_new_recruitment">
<div t-if="record.no_of_recruitment.raw_value gt 1"><t t-esc="record.no_of_recruitment.raw_value"/> Expected New Employees</div>
<div t-if="record.no_of_recruitment.raw_value lt 2"><t t-esc="record.no_of_recruitment.raw_value"/> Expected New Employee</div>
<div t-if="(record.no_of_recruitment.raw_value - record.no_of_hired_employee.raw_value) gt 1"><t t-esc="record.no_of_recruitment.raw_value - record.no_of_hired_employee.raw_value"/> Expected New Employees</div>
<div t-if="(record.no_of_recruitment.raw_value - record.no_of_hired_employee.raw_value) lt 2"><t t-esc="record.no_of_recruitment.raw_value - record.no_of_hired_employee.raw_value"/> Expected New Employee</div>
</div>
<field state="recruit" name="no_of_recruitment" widget="gage" style="width:200px; height:130px;" 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>
</t>
<t t-if="record.state.raw_value == 'open'">
<div class="oe_start_recruitment">
<p>To start a recruitment phase for this job position,<b>click here</b></p>
<p>To start the recruitment,<b>click here</b></p>
<img src="/hr_recruitment/static/src/img/down1.png"/>
</div>
</t>
+6 -8
View File
@@ -40,20 +40,18 @@ class hr_applicant_settings(osv.osv_memory):
def get_default_alias_prefix(self, cr, uid, ids, context=None):
alias_name = ''
mail_alias = self.pool.get('mail.alias')
model_ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'hr.applicant')], context=context)
alias_ids = mail_alias.search(cr, uid, [('alias_model_id', '=', model_ids[0])], context=context)
if alias_ids:
alias_name = mail_alias.browse(cr, uid, alias_ids[0], context=context).alias_name
alias = self.pool.get('ir.model.data').get_object(cr, uid, 'hr_recruitment', 'mail_alias_jobs')
if alias:
alias_name = alias.alias_name
return {'alias_prefix': alias_name}
def set_default_alias_prefix(self, cr, uid, ids, context=None):
mail_alias = self.pool.get('mail.alias')
record = self.browse(cr, uid, ids[0], context=context)
if record.alias_prefix:
model_ids = self.pool.get('ir.model').search(cr, uid, [('model', '=', 'hr.applicant')], context=context)
alias_ids = mail_alias.search(cr, uid, [('alias_model_id', '=', model_ids[0])], context=context)
if alias_ids:
mail_alias.write(cr, uid, alias_ids[0],{'alias_name': record.alias_prefix}, context=context)
alias = self.pool.get('ir.model.data').get_object(cr, uid, 'hr_recruitment', 'mail_alias_jobs')
if alias:
alias.write({'alias_name': record.alias_prefix})
else:
mail_alias.create_unique_alias(cr, uid, {'alias_name': record.alias_prefix}, model_name="hr.applicant", context=context)
@@ -1,17 +1,19 @@
.openerp .oe_kanban_job{
width: 355px;
min-height: 152px !important;
min-height: 125px !important;
}
.openerp .oe_job {
font-size: 112%;
position: inline;
margin: 3px 3px;
margin-left: 55px;
margin-left: 70px;
color: #4c4c4c;
}
.openerp img.oe_kanban_avatar {
margin-top: -23px;
width: 45px;
height: 45px;
margin-top: -40px;
position: absolute;
width: 60px;
height: 60px;
}
.openerp .oe_launch_recruitment{
float: right;
@@ -26,9 +28,11 @@
text-decoration: underline
}
.openerp .oe_name {
margin-left: 55px;
margin-top: -22px;
margin-bottom: -15px;
font-size: 14px;
}
.openerp .oe_manager_name {
margin-left: 70px;
position: absolute;
font-size: 11px;
color: gray;
}
@@ -40,7 +44,7 @@
color: #4c4c4c;
}
.openerp .oe_start_recruitment {
padding-top: 10px;
padding-top: 20px;
}
.openerp .oe_start_recruitment p {
font-size: 14px;