[IMP] improvements in hr modules

bzr revid: fp@tinyerp.com-20100407095457-ufpmz8rrdu7i39cx
This commit is contained in:
Fabien Pinckaers 2010-04-07 11:54:57 +02:00
commit 185277bdff
12 changed files with 106 additions and 125 deletions

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-05 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_contact

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-05 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm

View File

@ -101,8 +101,8 @@ class hr_employee(osv.osv):
'department_id':fields.many2one('hr.department','Department'),
'address_id': fields.many2one('res.partner.address', 'Working Address'),
'address_home_id': fields.many2one('res.partner.address', 'Home Address'),
'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone'),
'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail'),
'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone', readonly=True),
'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail', readonly=True),
'work_location': fields.char('Office Location', size=32),
'notes': fields.text('Notes'),

View File

@ -139,8 +139,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Contract Type">
<field colspan="4" name="name"/>
<field colspan="4" name="description"/>
<field colspan="4" name="name" select="1"/>
</form>
</field>
</record>
@ -220,6 +219,14 @@
</record>
<record id="action_hr_contract_type" model="ir.actions.act_window">
<field name="name">Contract Types</field>
<field name="res_model">hr.contract.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_hr_contract_type" id="hr_menu_contract_type" parent="next_id_56"/>
<menuitem id="hr_menu_contract_main" parent="hr.menu_hr_root" name="Contracts" sequence="3"/>
<menuitem action="action_hr_contract" id="hr_menu_contract" parent="hr_menu_contract_main" name="Contracts"/>
</data>

View File

@ -183,79 +183,48 @@ class hr_evaluation(osv.osv):
return {'value': {'plan_id':evaluation_plan_id}}
def button_plan_in_progress(self,cr, uid, ids, context={}):
user_obj = self.pool.get('res.users')
employee_obj = self.pool.get('hr.employee')
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
survey_request_obj = self.pool.get('survey.request')
hr_eval_plan_obj = self.pool.get('hr_evaluation.plan.phase')
curr_employee=self.browse(cr,uid, ids, context=context)[0].employee_id
child_employees=employee_obj.browse(cr,uid, employee_obj.search(cr,uid,[('parent_id','=',curr_employee.id)],context=context))
manager_employee=curr_employee.parent_id
for evaluation in self.browse(cr,uid,ids):
if evaluation and evaluation.plan_id:
apprai_id = []
for phase in evaluation.plan_id.phase_ids:
if phase.action == "bottom-up":
for child in child_employees:
user = False
if child.user_id:
user = child.user_id.id
id = hr_eval_inter_obj.create(cr, uid, {'evaluation_id':evaluation.id ,'user_id' : user,'survey_id' : phase.survey_id.id, 'user_to_review_id' : child.id, 'date_deadline' :(dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d')},context=context)
if not phase.wait:
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [id], context=context)
if phase.mail_feature:
src = tools.config.options['email_from']
user_obj_id = user_obj.browse(cr,uid,uid)
val = {
'employee_name':child.name,
'user_signature':curr_employee.name,
# 'company_name':user_obj_id.company_id.name,
'eval_name':phase.survey_id.title,
'date':time.strftime('%Y-%m-%d'),
}
mailbody = hr_eval_plan_obj.read(cr,uid,phase.id,['mail_body','email_subject'],context=context)
body = mailbody['mail_body']%val
sub = mailbody['email_subject']+phase.survey_id.title
dest=[child.work_email]
if dest:
tools.email_send(src,dest,sub,body)
apprai_id.append(id)
apprai_id = []
for evaluation in self.browse(cr,uid,ids, context):
wait = False
for phase in evaluation.plan_id.phase_ids:
childs = []
if phase.action == "bottom-up":
childs = evaluation.employee_id.child_ids
elif phase.action in ("top-down", "final"):
if evaluation.employee_id.parent_id:
childs = [evaluation.employee_id.parent_id]
elif phase.action == "self":
childs = [evaluation.employee_id]
for child in childs:
if not child.user_id:
continue
hr_eval_inter_obj = self.pool.get('hr.evaluation.interview')
int_id = hr_eval_inter_obj.create(cr, uid, {
'evaluation_id': evaluation.id,
'survey_id': phase.survey_id.id,
'date_deadline': (dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d'),
'user_id': child.user_id.id,
'user_to_review_id': evaluation.employee_id.id
}, context=context)
if phase.wait:
wait = True
if not wait:
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [int_id], context=context)
if (not wait) and phase.mail_feature:
body = phase.mail_body % {
'employee_name': child.name,
'user_signature': user.signature,
'eval_name': phase.survey_id.title,
'date': time.strftime('%Y-%m-%d'),
'time': time
}
sub = phase.email_subject
dest = [child.work_email]
if dest:
tools.email_send(src,dest,sub,body)
elif phase.action == "top-down":
if manager_employee:
user = False
if manager_employee.user_id:
user = manager_employee.user_id.id
id = hr_eval_inter_obj.create(cr, uid, {'evaluation_id':evaluation.id,'user_id': user ,'survey_id' : phase.survey_id.id, 'user_to_review_id' :manager_employee.id, 'date_deadline' :(dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d')},context=context)
if not phase.wait:
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [id], context=context)
if phase.mail_feature:
val.update({'employee_name':manager_employee.name})
mailbody = hr_eval_plan_obj.read(cr,uid,phase.id,['mail_body'],context=context)
body = mailbody['mail_body']%val
dest = [manager_employee.work_email]
if dest:
tools.email_send(src,dest,sub,body)
apprai_id.append(id)
elif phase.action == "self":
if curr_employee:
user = False
if curr_employee.user_id:
user = curr_employee.user_id.id
id = hr_eval_inter_obj.create(cr, uid, {'evaluation_id':evaluation.id,'user_id' : user, 'survey_id' : phase.survey_id.id, 'user_to_review_id' :curr_employee.id, 'date_deadline' :(dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d')},context=context)
if not phase.wait:
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [id], context=context)
apprai_id.append(id)
elif phase.action == "final":
if manager_employee:
user = False
if manager_employee.user_id:
user = manager_employee.user_id.id
id = hr_eval_inter_obj.create(cr, uid, {'evaluation_id':evaluation.id,'user_id' : user, 'survey_id' : phase.survey_id.id, 'user_to_review_id' :manager_employee.id, 'date_deadline' :(dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d')},context=context)
if not phase.wait:
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [id], context=context)
apprai_id.append(id)
self.write(cr, uid, evaluation.id, {'survey_request_ids':[[6, 0, apprai_id]]})
self.write(cr,uid,ids,{'state':'wait'},context=context)
return True
@ -291,21 +260,15 @@ class hr_evaluation_interview(osv.osv):
_description='Evaluation Interview'
_columns = {
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade'),
'user_to_review_id': fields.many2one('hr.employee', 'Employee'),
'evaluation_id' : fields.many2one('hr_evaluation.evaluation', 'Evaluation'),
}
'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'),
'evaluation_id' : fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'),
}
_defaults = {
'is_evaluation': lambda *a: True,
}
}
def survey_req_waiting_answer(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, { 'state' : 'waiting_answer'})
# for id in self.browse(cr, uid, ids):
# print"id",id
# if id.user_to_review_id and id.user_to_review_id.work_email:
# msg = " Hello %s, \n\n We are inviting you for %s survey. \n\n Thanks," %(id.user_to_review_id.name, id.survey_id.title)
# tools.email_send(tools.config['email_from'], [id.user_to_review_id.work_email],\
# 'Invite to fill up Survey', msg)
return True
def survey_req_done(self, cr, uid, ids, context={}):

View File

@ -167,7 +167,7 @@
<group col="6" colspan="4">
<field name="state"/>
<button name="button_plan_in_progress"
string="Plan In Progress"
string="Start Evaluation"
states="draft"
type="object"/>
<button name="button_final_validation"
@ -210,20 +210,30 @@
<field name="arch" type="xml">
<search string="Search Evaluation">
<group col='10' colspan='4'>
<filter icon="terp-hr" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-hr" string="Draft" domain="[('state','=','draft')]"/>
<filter icon="terp-crm" string="In progress" domain="[('state','=','wait')]"/>
<filter icon="terp-mrp" string="Final Step" domain="[('state','=','progress')]"/>
<filter icon="terp-stock" string="Done" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<filter icon="gtk-media-rewind" string="7 Days"
help="Evaluations to close within the next 7 days"
domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
/>
<filter icon="gtk-media-rewind" string="Overpassed"
help="Evaluations that overpassed the deadline"
domain="[('date','&gt;=',(datetime.date.today()))]"
/>
<separator orientation="vertical"/>
<field name="employee_id" widget="selection" select="1"/>
<field name="plan_id" widget="selection" select="1"/>
<field name="rating"/>
<newline/>
<group col='8' colspan='15' expand='1' string='Group by...'>
</group>
<newline/>
<group col='8' colspan='15' expand='1' string='Group by...'>
<filter string='Employee' icon="terp-stock" domain="[]" context="{'group_by' : 'employee_id'}" />
<filter string='Plan' icon="terp-stock" domain="[]" context="{'group_by' : 'plan_id'}" />
<filter string='state' icon="terp-stock" domain="[]" context="{'group_by' : 'state'}" />
</group>
<filter string='State' icon="terp-stock" domain="[]" context="{'group_by' : 'state'}" />
<separator orientation="vertical"/>
<filter string='Date' icon="terp-stock" domain="[]" context="{'group_by' : 'date'}" />
</group>
</search>
</field>
@ -282,6 +292,7 @@
<tree string="Interview Evaluation">
<field name="date_deadline"/>
<field name="survey_id"/>
<field name="user_id" string="Interviewer"/>
<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"
@ -300,14 +311,14 @@
<field name="arch" type="xml">
<search string="Search Evaluation">
<group col='10' colspan='4'>
<filter icon="terp-crm" string="Unanswered" domain="[('state','=','waiting_answer')]"/>
<filter icon="terp-crm" string="To Do" domain="[('state','=','waiting_answer')]" default="1"/>
<separator orientation="vertical"/>
<filter string="My" icon="terp-partner" domain="[('user_id','=',uid)]" default="1"/>
<separator orientation="vertical"/>
<filter icon="terp-stock" string="Late" domain="[('date_deadline','&lt;',current_date)]"/>
<separator orientation="vertical"/>
<field name="survey_id" widget="selection" select="1"/>
<field name="email" select="1"/>
<field name="user_id" select="1" widget="selection" default="1">
<filter string="MY" icon="terp-partner" domain="[('user_id','=',uid)]"/>
</field>
<field name="user_to_review_id" widget="selection"/>
<field name="user_id" widget="selection"/>
</group>
</search>
</field>
@ -322,7 +333,7 @@
</record>
<menuitem
name="Intreview Requests" parent="menu_eval_hr"
name="Interview Requests" parent="menu_eval_hr"
id="menu_open_hr_evaluation_interview_requests"
action="action_hr_evaluation_interview_tree"/>

View File

@ -256,7 +256,7 @@ class hr_holidays(osv.osv):
'number_of_days': nb,
'user_id': user_id
})
return True
return True
def holidays_refuse(self, cr, uid, ids, *args):
vals = {

View File

@ -10,17 +10,19 @@
<group col='8' colspan='4'>
<filter icon="terp-hr" domain="[('state','=','draft')]" string="To Confirm"/>
<filter icon="terp-hr" domain="[('state','=','confirm')]" string="To Validate"/>
<filter icon="terp-hr" domain="[('department_id','=',context.get('department_id',False))]"
string="My Departments Leaves"/>
<separator orientation="vertical"/>
<filter icon="terp-hr" domain="[('type','=','remove')]" string="Leaves"/>
<filter icon="terp-hr" domain="[('type','=','add')]" string="Allocations"/>
<separator orientation="vertical"/>
<filter icon="terp-hr" help="My Leaves" domain="[('user_id','=',uid)]" string="My Leaves"/>
<separator orientation="vertical"/>
<field name="user_id" select="1" widget="selection" />
<field name="department_id" select="1" widget="selection" />
<field name="name" select='1'/>
<field name="state" select="1">
<filter icon="terp-hr" domain="[('state','=','refuse')]" help="Refused Holidays"/>
<filter icon="terp-hr" domain="[('state','=','validate')]" help="Validated Holidays"/>
</field>
<field name="user_id" widget="selection" />
<field name="department_id" widget="selection">
<filter icon="terp-hr"
domain="[('department_id.manager_id','=',uid)]"
/>
</field>
<field name="holiday_status_id"/>
</group>
<newline />
<group expand="1" string="Group By..." colspan="11" col="11">
@ -31,8 +33,6 @@
</field>
</record>
<!-- Holidays: Leave Request -->
<record model="ir.ui.view" id="edit_holiday_new">
<field name="name">Leave Request</field>

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-22 19:08+0000\n"
"PO-Revision-Date: 2010-04-06 23:02+0000\n"
"Last-Translator: Ferdinand @ ChriCar <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:06+0000\n"
"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_timesheet
@ -351,7 +351,7 @@ msgstr "März"
#: xsl:hr.analytical.timesheet:0
#: xsl:hr.analytical.timesheet_users:0
msgid "Total"
msgstr "Betrag gesammt"
msgstr "Betrag gesamt"
#. module: hr_timesheet
#: selection:hr.analytical.timesheet,init,month:0

View File

@ -32,10 +32,10 @@ class l10n_be_vat_declaration(osv.osv_memory):
'period_id': fields.many2one('account.period','Period', required=True),
'msg': fields.text('File created', size=64, readonly=True),
'file_save': fields.binary('Save File'),
'ask_resitution': {'type': 'boolean', 'string': 'Ask Restitution',},
'ask_payment': {'type': 'boolean', 'string': 'Ask Payment',},
'client_nihil': {'type': 'boolean', 'string': 'Last Declaration of Entreprise', 'help': 'Thick this case only if it concerns only the last statement on the civil or cessation of activity'},
}
'ask_resitution': fields.boolean('Ask Restitution'),
'ask_payment': fields.boolean('Ask Payment'),
'client_nihil': fields.boolean('Last Declaration of Entreprise',help='Thick this case only if it concerns only the last statement on the civil or cessation of activity'),
}
_defaults = {
'msg': lambda *a:'''Save the File with '".xml"' extension.''',

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-05 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_purchase

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-05 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-04-07 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: scrum