Tejas Tank (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-first-10clicks-hr2 into lp:openobject-addons.
Requested reviews: OpenERP Core Team (openerp) For more details, see: https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-first-10clicks-hr2/+merge/135678 Hello, The solution related to task [first 10 Clicks hr#2] Here Timesheet, Recruitment, Appraisals and Interview Requests related changes are applied. Thanks, Tejas(TTa) -- https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-first-10clicks-hr2/+merge/135678 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-first-10clicks-hr2.
=== modified file 'hr/hr.py' --- hr/hr.py 2012-11-13 15:03:37 +0000 +++ hr/hr.py 2012-11-22 13:18:31 +0000 @@ -116,7 +116,7 @@ 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', } === modified file 'hr_evaluation/hr_evaluation.py' --- hr_evaluation/hr_evaluation.py 2012-11-15 12:38:51 +0000 +++ hr_evaluation/hr_evaluation.py 2012-11-22 13:18:31 +0000 @@ -187,13 +187,17 @@ 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') + 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') === modified file 'hr_evaluation/hr_evaluation_view.xml' --- hr_evaluation/hr_evaluation_view.xml 2012-11-15 12:38:51 +0000 +++ hr_evaluation/hr_evaluation_view.xml 2012-11-22 13:18:31 +0000 @@ -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" === modified file 'hr_holidays/hr_holidays.py' --- hr_holidays/hr_holidays.py 2012-11-15 12:38:51 +0000 +++ hr_holidays/hr_holidays.py 2012-11-22 13:18:31 +0000 @@ -424,7 +424,7 @@ 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 === modified file 'hr_recruitment/hr_recruitment_view.xml' --- hr_recruitment/hr_recruitment_view.xml 2012-11-15 12:38:51 +0000 +++ hr_recruitment/hr_recruitment_view.xml 2012-11-22 13:18:31 +0000 @@ -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> === modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py' --- hr_timesheet_sheet/hr_timesheet_sheet.py 2012-10-30 05:03:23 +0000 +++ hr_timesheet_sheet/hr_timesheet_sheet.py 2012-11-22 13:18:31 +0000 @@ -95,10 +95,20 @@ 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=context) else: raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,)) return True + def button_cancel(self, cr, uid, ids, context=None): + for sheet in self.browse(cr, uid, ids, context=context): + if sheet.employee_id and sheet.employee_id.user_id: + self.message_subscribe_users(cr, uid, [sheet.id], user_ids=[sheet.employee_id.user_id.id], context=context) + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'cancel', cr) + self.cancel_send_note(cr, uid, ids, context=context) + return True + def attendance_action_change(self, cr, uid, ids, context=None): hr_employee = self.pool.get('hr.employee') employee_ids = [] @@ -169,7 +179,8 @@ '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 +232,25 @@ 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), subtype="hr_timesheet_sheet.mt_submit_timesheet", context=context) + + def cancel_send_note(self, cr, uid, ids, context=None): + user_name = self.pool.get("res.users").browse(cr, uid, uid, context=context).name + for obj in self.browse(cr, uid, ids, context=context): + self.message_post(cr, uid, [obj.id], body=_("Timesheet has been refused by %s.") % (user_name), subtype="hr_timesheet_sheet.mt_refuse_timesheet", context=context) + hr_timesheet_sheet() class account_analytic_line(osv.osv): === modified file 'hr_timesheet_sheet/hr_timesheet_sheet_data.xml' --- hr_timesheet_sheet/hr_timesheet_sheet_data.xml 2012-11-14 11:55:04 +0000 +++ hr_timesheet_sheet/hr_timesheet_sheet_data.xml 2012-11-22 13:18:31 +0000 @@ -22,6 +22,16 @@ </record> <menuitem name="My Current Timesheet" id="menu_act_hr_timesheet_sheet_form_my_current" parent="hr_attendance.menu_hr_time_tracking" action="ir_actions_server_timsheet_sheet" sequence="1"/> + + <record id="mt_submit_timesheet" model="mail.message.subtype"> + <field name="name">Submit</field> + <field name="res_model">hr_timesheet_sheet.sheet</field> + </record> + + <record id="mt_refuse_timesheet" model="mail.message.subtype"> + <field name="name">Refuse</field> + <field name="res_model">hr_timesheet_sheet.sheet</field> + </record> </data> </openerp> === modified file 'hr_timesheet_sheet/hr_timesheet_sheet_view.xml' --- hr_timesheet_sheet/hr_timesheet_sheet_view.xml 2012-11-15 08:34:00 +0000 +++ hr_timesheet_sheet/hr_timesheet_sheet_view.xml 2012-11-22 13:18:31 +0000 @@ -66,7 +66,7 @@ <button name="button_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/> <button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/> <button name="action_set_to_draft" states="done" string="Set to Draft" type="object" /> - <button name="cancel" states="confirm" string="Refuse" type="workflow" groups="base.group_hr_user" /> + <button name="button_cancel" states="confirm" string="Refuse" type="object" groups="base.group_hr_user" /> <field name="state" widget="statusbar" statusbar_visible="new,confirm,done"/> </header> <sheet> === modified file 'survey/report/survey_form.py' --- survey/report/survey_form.py 2011-01-14 00:11:01 +0000 +++ survey/report/survey_form.py 2012-11-22 13:18:31 +0000 @@ -135,7 +135,7 @@ </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 @@ 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"> === modified file 'survey/survey_view.xml' --- survey/survey_view.xml 2012-11-21 16:27:53 +0000 +++ survey/survey_view.xml 2012-11-22 13:18:31 +0000 @@ -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')]}"/> === modified file 'survey/wizard/survey_answer.py' --- survey/wizard/survey_answer.py 2012-10-29 09:14:15 +0000 +++ survey/wizard/survey_answer.py 2012-11-22 13:18:31 +0000 @@ -185,8 +185,9 @@ 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
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-gtk Post to : openerp-dev-gtk@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-dev-gtk More help : https://help.launchpad.net/ListHelp