Merged : lp:~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde
bzr revid: tta@openerp.com-20121121133008-n12jzpi874cz21gw
This commit is contained in:
+1
-1
@@ -116,7 +116,7 @@ class hr_job(osv.osv):
|
||||
help="By default 'In position', set it to 'In Recruitment' if recruitment process is going on for this job position."),
|
||||
}
|
||||
_defaults = {
|
||||
'expected_employees': 1,
|
||||
'expected_employees': 0.00,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
|
||||
'state': 'open',
|
||||
}
|
||||
|
||||
@@ -187,13 +187,17 @@ class hr_evaluation(osv.osv):
|
||||
return res
|
||||
|
||||
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
|
||||
evaluation_plan_id=False
|
||||
vals = {}
|
||||
vals['plan_id']=False
|
||||
vals['date']=False
|
||||
if employee_id:
|
||||
employee_obj=self.pool.get('hr.employee')
|
||||
for employee in employee_obj.browse(cr, uid, [employee_id], context=context):
|
||||
if employee and employee.evaluation_plan_id and employee.evaluation_plan_id.id:
|
||||
evaluation_plan_id=employee.evaluation_plan_id.id
|
||||
return {'value': {'plan_id':evaluation_plan_id}}
|
||||
vals.update({'plan_id':employee.evaluation_plan_id.id})
|
||||
if employee.evaluation_date :
|
||||
vals.update({'date': employee.evaluation_date})
|
||||
return {'value': vals}
|
||||
|
||||
def button_plan_in_progress(self, cr, uid, ids, context=None):
|
||||
mail_message = self.pool.get('mail.message')
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
<button string="Send Request" name="survey_req_waiting_answer" type="object"
|
||||
states="draft" class="oe_highlight"/>
|
||||
<button string="Answer Survey" name="%(survey.action_view_survey_question_message)d" type="action"
|
||||
states="waiting_answer"
|
||||
states="waiting_answer" class="oe_highlight"
|
||||
context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}"
|
||||
attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button string="Done" name="survey_req_done" type="object"
|
||||
|
||||
@@ -424,7 +424,7 @@ class hr_holidays(osv.osv):
|
||||
|
||||
def create_notificate(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_post(cr, uid, ids,
|
||||
self.message_post(cr, uid, [obj.id],
|
||||
_("Request <b>created</b>, waiting confirmation."), context=context)
|
||||
return True
|
||||
|
||||
|
||||
@@ -106,11 +106,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Jobs - Recruitment Form" version="7.0">
|
||||
<header>
|
||||
<button name="case_close_with_emp" string="Hire & Create Employee" type="object"
|
||||
states="draft,open,pending,done" class="oe_highlight"/>
|
||||
<button name="case_close_with_emp" string="Hire" type="object"
|
||||
class="oe_highlight"
|
||||
attrs="{'invisible':['|',('emp_id','!=',False), ('state','=','cancel')]}"/>
|
||||
<button name="case_cancel" string="Refuse" type="object"
|
||||
states="draft,open,pending" class="oe_highlight"/>
|
||||
<field name="stage_id" widget="statusbar" clickable="True"/>
|
||||
<field name="emp_id" invisible="1"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_right oe_button_box">
|
||||
@@ -145,7 +147,8 @@
|
||||
<field name="user_id"/>
|
||||
<label for="title_action"/>
|
||||
<div>
|
||||
<field name="date_action"/> -
|
||||
<field name="date_action"/>
|
||||
<span class="oe_edit_only"> - </span>
|
||||
<field name="title_action" class="oe_inline" placeholder="e.g. Call for interview"/>
|
||||
</div>
|
||||
<field name="priority"/>
|
||||
@@ -166,12 +169,14 @@
|
||||
<group string="Contract">
|
||||
<label for="salary_expected"/>
|
||||
<div>
|
||||
<field name="salary_expected" class="oe_inline"/>,
|
||||
<field name="salary_expected" class="oe_inline"/>
|
||||
<span class="oe_inline" attrs="{'invisible':[('salary_expected_extra','=',False)]}">, </span>
|
||||
<field name="salary_expected_extra" class="oe_inline" placeholder="Extra advantages..."/>
|
||||
</div>
|
||||
<label for="salary_proposed"/>
|
||||
<div>
|
||||
<field name="salary_proposed" class="oe_inline"/>,
|
||||
<field name="salary_proposed" class="oe_inline"/>
|
||||
<span class="oe_inline" attrs="{'invisible':[('salary_proposed_extra','=',False)]}">, </span>
|
||||
<field name="salary_proposed_extra" class="oe_inline" placeholder="Extra advantages..."/>
|
||||
</div>
|
||||
</group>
|
||||
@@ -281,7 +286,6 @@
|
||||
<div class="oe_dropdown_toggle oe_dropdown_kanban">
|
||||
<span class="oe_e">i</span>
|
||||
<ul class="oe_dropdown_menu">
|
||||
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
|
||||
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
|
||||
<li><a name="action_makeMeeting" type="object">Schedule Interview</a></li>
|
||||
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
|
||||
@@ -433,7 +437,7 @@
|
||||
<form string="Degree" version="7.0">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="sequence" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -95,6 +95,7 @@ class hr_timesheet_sheet(osv.osv):
|
||||
if (abs(sheet.total_difference) < di) or not di:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
|
||||
self.confirm_send_note(cr, uid, ids, context)
|
||||
else:
|
||||
raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
|
||||
return True
|
||||
@@ -169,7 +170,8 @@ class hr_timesheet_sheet(osv.osv):
|
||||
'date_to' : _default_date_to,
|
||||
'state': 'new',
|
||||
'employee_id': _default_employee,
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c),
|
||||
'user_id': _default_employee
|
||||
}
|
||||
|
||||
def _sheet_date(self, cr, uid, ids, forced_user_id=False, context=None):
|
||||
@@ -221,6 +223,20 @@ class hr_timesheet_sheet(osv.osv):
|
||||
department_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).department_id.id
|
||||
return {'value': {'department_id': department_id}}
|
||||
|
||||
# ------------------------------------------------
|
||||
# OpenChatter methods and notifications
|
||||
# ------------------------------------------------
|
||||
|
||||
def needaction_domain_get(self, cr, uid, ids, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
empids = emp_obj.search(cr, uid, [('parent_id.user_id', '=', uid)], context=context)
|
||||
dom = ['&', ('state', '=', 'confirm'), ('employee_id', 'in', empids)]
|
||||
return dom
|
||||
|
||||
def confirm_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_post(cr, uid, [obj.id], body=_("Timesheet has been submitted by %s.") % (obj.employee_id.name), context=context)
|
||||
|
||||
hr_timesheet_sheet()
|
||||
|
||||
class account_analytic_line(osv.osv):
|
||||
|
||||
@@ -135,7 +135,7 @@ class survey_form(report_rml):
|
||||
</initialize>
|
||||
<paraStyle name="response" fontName="Helvetica-oblique" fontSize="9.5"/>
|
||||
<paraStyle name="page" fontName="helvetica-bold" fontSize="15.0" leftIndent="0.0" textColor="white"/>
|
||||
<paraStyle name="title" fontName="helvetica-bold" fontSize="18.0" leftIndent="0.0" textColor="white"/>
|
||||
<paraStyle name="title" fontName="helvetica-bold" fontSize="18.0" leading="15" leftIndent="0.0" textColor="white"/>
|
||||
<paraStyle name="question" fontName="helvetica-boldoblique" fontSize="10.0" leftIndent="3.0"/>
|
||||
<paraStyle name="answer" fontName="helvetica" fontSize="09.0" leftIndent="0.0"/>
|
||||
<paraStyle name="descriptive_text" fontName="helvetica" fontSize="10.0" leftIndent="0.0"/>
|
||||
@@ -165,7 +165,7 @@ class survey_form(report_rml):
|
||||
seq += 1
|
||||
rml += """
|
||||
<blockTable colWidths='"""+_tbl_widths+"""' style="page_tbl">
|
||||
<tr><td><para style="page">"""+ tools.ustr(seq) + """. """ + to_xml(tools.ustr(page.title)) + """</para></td></tr>
|
||||
<tr><td><para style="page">"""+ tools.ustr(seq) + """. """ + to_xml(tools.ustr(page.title)) + """</para><para style="P2"><font></font></para></td></tr>
|
||||
</blockTable>"""
|
||||
if page.note:
|
||||
rml += """<para style="P2"></para><blockTable colWidths='"""+_tbl_widths+"""' style="note_table">
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
<group>
|
||||
<field name="id" invisible="1"/>
|
||||
<field name="responsible_id" class="oe_inline" attrs="{'readonly':[('state','=','close')]}"/>
|
||||
<field name="type" attrs="{'readonly':[('state','=','close')]}" class="oe_inline"/>
|
||||
<field name="send_response" attrs="{'readonly':[('state','=','close')]}"/>
|
||||
<field name="type" attrs="{'readonly':[('state','=','close')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="max_response_limit" attrs="{'readonly':[('state','=','close')]}"/>
|
||||
|
||||
@@ -185,8 +185,9 @@ class survey_question_wiz(osv.osv_memory):
|
||||
etree.SubElement(xml_form, 'field', {'invisible':'1','name': "wizardid_" + str(wiz_id),'default':str(lambda *a: 0),'modifiers':'{"invisible":true}'})
|
||||
|
||||
if note:
|
||||
xml_group_note = etree.SubElement(xml_form, 'group', {'col': '1','colspan': '4'})
|
||||
for que_test in note.split('\n'):
|
||||
etree.SubElement(xml_form, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
|
||||
etree.SubElement(xml_group_note, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
|
||||
que_ids = question_ids
|
||||
qu_no = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user