[IMP] improved view and code to show default alias for job

bzr revid: tpa@tinyerp.com-20130704083631-e0cyn2fxpqfhg5hb
This commit is contained in:
Turkesh Patel (Open ERP) 2013-07-04 14:06:31 +05:30
parent fb58f9ad8f
commit e4fd9bb105
4 changed files with 18 additions and 8 deletions

View File

@ -343,10 +343,12 @@
<field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
</header>
<sheet>
<div class="oe_right oe_button_box" name="buttons"/>
<group>
<div class="oe_job_title_form">
<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>
</div>
<div class="oe_right oe_job_button_box" name="buttons"/>
<group>
<group colspan="4">
<group name="job_data">
<field name="no_of_employee" groups="base.group_user"/>

View File

@ -73,3 +73,10 @@
width: auto;
float: none;
}
.openerp .oe_job_title_form {
width: 75%;
float: left;
}
.openerp .oe_job_button_box {
width: 24%;
}

View File

@ -333,12 +333,12 @@
</div>
</div>
<field name="alias_contact" class="oe_inline" string="Accept Emails From"/>
<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>
</group>
</xpath>
<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>

View File

@ -106,10 +106,11 @@ class mail_thread(osv.AbstractModel):
object_id.alias_id.alias_model_id.model == self._name and \
object_id.alias_id.alias_force_thread_id == 0:
alias = object_id.alias_id
elif catchall_domain and model: # no specific res_id given -> generic help message, take an example alias (i.e. alias of some section_id)
if catchall_domain and model and not alias: #check for example alias if res_id not given or given res_id dose not contain alias-> generic help message, take an example alias (i.e. alias of some section_id)
model_id = self.pool.get('ir.model').search(cr, uid, [("model", "=", self._name)], context=context)[0]
alias_obj = self.pool.get('mail.alias')
alias_ids = alias_obj.search(cr, uid, [("alias_model_id", "=", model_id), ("alias_name", "!=", False), ('alias_force_thread_id', '=', 0)], context=context, order='id ASC')
alias_ids = alias_obj.search(cr, uid, [("alias_model_id", "=", model_id), ("alias_name", "!=", False), ('alias_force_thread_id', '=', False), ('alias_parent_thread_id', '=', False)], context=context, order='id ASC')
if alias_ids and len(alias_ids) == 1: # if several aliases -> incoherent to propose one guessed from nowhere, therefore avoid if several aliases
alias = alias_obj.browse(cr, uid, alias_ids[0], context=context)