[MERGE] hr_evaluation: merge with mma branch related to hr_evaluation changes

bzr revid: psi@tinyerp.com-20120229100639-smuiy6xoronwg6rn
This commit is contained in:
Purnendu Singh (OpenERP)
2012-02-29 15:36:39 +05:30
6 changed files with 19 additions and 62 deletions
-6
View File
@@ -167,7 +167,6 @@ class hr_evaluation(osv.osv):
('cancel','Cancelled'),
], 'State', required=True, readonly=True),
'date_close': fields.date('Ending Date', select=True),
'progress': fields.float("Progress"),
}
_defaults = {
'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'),
@@ -245,7 +244,6 @@ class hr_evaluation(osv.osv):
return True
def button_done(self,cr, uid, ids, context=None):
self.write(cr, uid, ids,{'progress': 1 * 100}, context=context)
self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context)
return True
@@ -312,7 +310,6 @@ class hr_evaluation_interview(osv.osv):
for id in self.browse(cr, uid, ids, context=context):
flag = False
wating_id = 0
tot_done_req = 1
if not id.evaluation_id.id:
raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Appraisal."))
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids
@@ -322,11 +319,8 @@ class hr_evaluation_interview(osv.osv):
continue
if child.state != "done":
flag = True
else:
tot_done_req += 1
if not flag and wating_id:
self.survey_req_waiting_answer(cr, uid, [wating_id], context=context)
hr_eval_obj.write(cr, uid, [id.evaluation_id.id], {'progress': tot_done_req * 100 / len(records)}, context=context)
self.write(cr, uid, ids, { 'state': 'done'}, context=context)
return True
+2 -41
View File
@@ -2,7 +2,7 @@
<openerp>
<data noupdate="1">
<record id="survey_2" model="survey">
<field name="title">Employee Appraisal</field>
<field name="title">Self Appraisal</field>
<field name="max_response_limit">20</field>
<field eval="[(6,0,[])]" name="users"/>
<field name="type" ref="survey.survey_type1"/>
@@ -1157,37 +1157,11 @@ Once the form had been filled, the employee send it to his supervisor.
</data>
<data noupdate="1">
<record id="hr_evaluation_plan_phase_sendtosubordinates0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
<field name="name">Send to Subordinates</field>
<field eval="0" name="send_anonymous_manager"/>
<field eval="1" name="sequence"/>
<field name="company_id" ref="base.main_company"/>
<field name="action">bottom-up</field>
<field eval="0" name="send_anonymous_employee"/>
<field eval="0" name="send_answer_employee"/>
<field name="survey_id" ref="hr_evaluation.survey_2"/>
<field eval="0" name="send_answer_manager"/>
<field eval="0" name="wait"/>
</record>
<record id="hr_evaluation_plan_phase_sendtomanagers0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
<field name="name">Send to Managers</field>
<field eval="0" name="send_anonymous_manager"/>
<field eval="2" name="sequence"/>
<field name="company_id" ref="base.main_company"/>
<field name="action">top-down</field>
<field eval="0" name="send_anonymous_employee"/>
<field eval="0" name="send_answer_employee"/>
<field name="survey_id" ref="hr_evaluation.survey_2"/>
<field eval="0" name="send_answer_manager"/>
<field eval="0" name="wait"/>
</record>
<record id="hr_evaluation_plan_phase_sendtoemployee0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
<field name="name">Send to Employee</field>
<field eval="0" name="send_anonymous_manager"/>
<field eval="3" name="sequence"/>
<field eval="1" name="sequence"/>
<field name="company_id" ref="base.main_company"/>
<field name="action">self</field>
<field eval="0" name="send_anonymous_employee"/>
@@ -1196,19 +1170,6 @@ Once the form had been filled, the employee send it to his supervisor.
<field eval="0" name="send_answer_manager"/>
<field eval="0" name="wait"/>
</record>
<record id="hr_evaluation_plan_phase_finalinterviewwithmanager0" model="hr_evaluation.plan.phase">
<field name="plan_id" ref="hr_evaluation_plan_managersevaluationplan0"/>
<field name="name">Final Interview With Manager</field>
<field eval="0" name="send_anonymous_manager"/>
<field eval="4" name="sequence"/>
<field name="company_id" ref="base.main_company"/>
<field name="action">final</field>
<field eval="0" name="send_anonymous_employee"/>
<field eval="0" name="send_answer_employee"/>
<field name="survey_id" ref="hr_evaluation.survey_2"/>
<field eval="0" name="send_answer_manager"/>
<field eval="1" name="wait"/>
</record>
</data>
<data noupdate="1">
+16 -10
View File
@@ -160,15 +160,14 @@
<field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
<field name="plan_id"/>
<field name="date"/>
<field name="progress" widget="progressbar"/>
</group>
<group col="2" colspan="1">
<group col="2" colspan="1" attrs="{'invisible':['|', ('state','=','draft'), ('state', '=', 'wait')]}">
<separator string="Ending Summary" colspan="2"/>
<field name="rating" attrs="{'readonly':[('state','&lt;&gt;','progress')],'required':[('state','=','progress')]}"/>
<field name="date_close" readonly="1"/>
</group>
<notebook colspan="4">
<page string="Appraisal">
<page string="Appraisal" attrs="{'invisible':[('state','=','draft')]}">
<field name="survey_request_ids" nolabel="1" colspan="4" widget="one2many">
<form string="Interview Appraisal">
<group col="4" colspan="4">
@@ -190,19 +189,17 @@
</form>
</field>
</page>
<page string="Internal Notes">
<page string="Internal Notes" attrs="{'invisible':[('state','=','draft')]}">
<field name="note_action" colspan="4" nolabel="1"
groups="base.group_hr_manager"/>
</page>
<page string="Public Notes">
<page string="Public Notes" attrs="{'invisible':[('state','=','draft')]}">
<field name="note_summary" colspan="4" nolabel="1"/>
</page>
</notebook>
<newline/>
<group col="8" colspan="4">
<field name="state" widget="statusbar" statusbar_visible="draft,progress,wait,done" statusbar_colors='{"progress":"blue"}'/>
<button name="button_cancel" string="Cancel" states="draft,wait,progress" type="object"
icon="gtk-cancel"/>
<button name="button_plan_in_progress" string="Start Appraisal" states="draft" type="object"
icon="gtk-execute"/>
<button name="button_done" string="Done" states="progress" type="object"
@@ -211,6 +208,8 @@
icon="terp-stock_effects-object-colorize"/>
<button name="button_final_validation" string="Validate Appraisal" states="wait" type="object"
icon="gtk-go-forward"/>
<button name="button_cancel" string="Cancel" states="draft,wait,progress" type="object"
icon="gtk-cancel"/>
</group>
</form>
</field>
@@ -259,6 +258,9 @@
<separator orientation="vertical"/>
<filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
help="Appraisal that overpassed the deadline" domain="[('date','&lt;=',(datetime.date.today()).strftime('%%Y-%%m-%%d'))]" />
<filter icon="terp-go-month" name="next_month" string=" Month+1"
domain="[('date','&lt;=', (datetime.date.today() + relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('date','&gt;=',(datetime.date.today() + relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d')),('state','=','draft')]"
help="Appraisal during next month"/>
<separator orientation="vertical"/>
<field name="employee_id" />
<field name="plan_id" widget="selection" />
@@ -282,6 +284,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
<field name="context">{"search_default_next_month":1}</field>
<field name="help">Each employee may be assigned an Appraisal Plan. Such a plan defines the frequency and the way you manage your periodic personnel evaluation. You will be able to define steps and attach interviews to each step. OpenERP manages all kind of evaluations: bottom-up, top-down, self-evaluation and final evaluation by the manager.</field>
</record>
@@ -299,7 +302,6 @@
<field name="evaluation_id"/>
<group col="2" colspan="2">
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" 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 name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
</group>
<field name="date_deadline"/>
<field name="response" readonly="1"/>
@@ -316,7 +318,10 @@
<newline/>
<separator string="State" colspan="4"/>
<group colspan="4" col="6">
<field name="state"/>
<field name="state" widget="statusbar" statusbar_visible="waiting_answer,done"/>
<button string="Send Request" name="survey_req_waiting_answer" states="draft" type="object" icon="gtk-yes" />
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
<button string="Cancel" name="survey_req_cancel" states="draft,waiting_answer" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
@@ -334,10 +339,11 @@
<field name="user_to_review_id"/>
<field name="response" readonly="1" invisible="True"/>
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" 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 name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0}" attrs="{'readonly':[('response','=',False)]}" />
<button name="action_print_survey" string="Print Survey" type="object" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(mail.action_email_compose_message_wizard)d" string="Send Reminder Email" icon="terp-mail-message-new" type="action" colspan="2" states="waiting_answer"/>
<field name="state"/>
<button string="Send Request" name="survey_req_waiting_answer" states="draft" type="object" icon="gtk-yes" />
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to" />
</tree>
</field>
</record>
@@ -31,7 +31,6 @@ class hr_evaluation_report(osv.osv):
'create_date': fields.date('Create Date', readonly=True),
'delay_date':fields.float('Delay to Start', digits=(16,2),readonly=True),
'overpass_delay':fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
'progress_bar' : fields.float("Progress"),
'day': fields.char('Day', size=128, readonly=True),
'deadline': fields.date("Deadline", readonly=True),
'request_id': fields.many2one('survey.request', 'Request_id', readonly=True),
@@ -77,7 +76,6 @@ class hr_evaluation_report(osv.osv):
to_char(s.create_date, 'MM') as month,
count(l.*) as nbr,
s.state,
s.progress as progress_bar,
avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_date,
avg(extract('epoch' from age(s.date,CURRENT_DATE)))/(3600*24) as overpass_delay
from
@@ -96,7 +94,6 @@ class hr_evaluation_report(osv.osv):
s.date_close,
l.request_id,
s.rating,
s.progress,
s.plan_id
)
""")
@@ -20,7 +20,6 @@
<field name="rating" invisible="1"/>
<field name="state" invisible="1"/>
<field name="nbr" sum="# of Requests"/>
<field name="progress_bar" widget="progressbar"/>
<field name="delay_date"/>
<field name="overpass_delay"/>
</tree>
@@ -25,7 +25,7 @@ access_survey_page_hr_user,survey.page.hr.user,survey.model_survey_page,base.gro
access_survey_response_hr_user,survey.response.hr.user,survey.model_survey_response,base.group_hr_user,1,1,1,0
access_survey_history_hr_user,survey.history.hr.user,survey.model_survey_history,base.group_hr_user,1,1,1,0
access_survey_request_hr_user,survey.request.hr.user,survey.model_survey_request,base.group_hr_user,1,1,1,0
access_survey_question_column_heading_hr_user,survey.question.column.heading.hr.user,survey.model_survey_question_column_heading,base.group_hr_user,1,0,0,0
access_survey_question_column_heading_hr_user,survey.question.column.heading.hr.user,survey.model_survey_question_column_heading,base.group_hr_user,1,1,1,0
access_survey_response_line_hr_user,survey.response.line.hr.user,survey.model_survey_response_line,base.group_hr_user,1,1,1,0
access_survey_tbl_column_heading_hr_user,survey.tbl.column.heading.hr.user,survey.model_survey_tbl_column_heading,base.group_hr_user,1,1,1,0
access_base_calendar_attendee_survey_user,base.calendar.calendar.attendee.survey.user,base_calendar.model_calendar_attendee,base.group_survey_user,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
25 access_survey_response_hr_user survey.response.hr.user survey.model_survey_response base.group_hr_user 1 1 1 0
26 access_survey_history_hr_user survey.history.hr.user survey.model_survey_history base.group_hr_user 1 1 1 0
27 access_survey_request_hr_user survey.request.hr.user survey.model_survey_request base.group_hr_user 1 1 1 0
28 access_survey_question_column_heading_hr_user survey.question.column.heading.hr.user survey.model_survey_question_column_heading base.group_hr_user 1 0 1 0 1 0
29 access_survey_response_line_hr_user survey.response.line.hr.user survey.model_survey_response_line base.group_hr_user 1 1 1 0
30 access_survey_tbl_column_heading_hr_user survey.tbl.column.heading.hr.user survey.model_survey_tbl_column_heading base.group_hr_user 1 1 1 0
31 access_base_calendar_attendee_survey_user base.calendar.calendar.attendee.survey.user base_calendar.model_calendar_attendee base.group_survey_user 1 1 1 0