diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index bc1ab42b3df..cadd813a959 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -40,8 +40,8 @@ class crm_meeting(base_state, osv.Model): _columns = { # base_state required fields 'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}), - 'section_id': fields.many2one('crm.case.section', 'Sales Team', states={'done': [('readonly', True)]}, \ - select=True, help='Sales team to which Case belongs to.'), + 'section_id': fields.many2one('crm.case.section', 'Sales Team', states={'done': [('readonly', True)]}, + select=True, groups='base.group_sale_salesman', help='Sales team to which Case belongs to.'), 'email_from': fields.char('Email', size=128, states={'done': [('readonly', True)]}, help="These people will receive email."), 'create_date': fields.datetime('Creation Date' , readonly=True), 'write_date': fields.datetime('Write Date' , readonly=True), diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 32c291044c0..e2bca73a72e 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -93,24 +93,27 @@ class hr_job(osv.osv): _description = "Job Description" _columns = { 'name': fields.char('Job Name', size=128, required=True, select=True), - 'expected_employees': fields.function(_no_of_employee, string='Expected Employees', help='Required number of employees in total for that job.', + 'expected_employees': fields.function(_no_of_employee, string='Total Employees', + help='Expected number of employees for this job position after new recruitment.', store = { 'hr.job': (lambda self,cr,uid,ids,c=None: ids, ['no_of_recruitment'], 10), 'hr.employee': (_get_job_position, ['job_id'], 10), }, multi='no_of_employee'), - 'no_of_employee': fields.function(_no_of_employee, string="Number of Employees", help='Number of employees with that job.', + 'no_of_employee': fields.function(_no_of_employee, string="Number of Employees", + help='Number of employees currently occupying this job position.', store = { 'hr.employee': (_get_job_position, ['job_id'], 10), }, multi='no_of_employee'), - 'no_of_recruitment': fields.float('Expected in Recruitment'), + 'no_of_recruitment': fields.float('Expected in Recruitment', help='Number of new employees you expect to recruit.'), 'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'), 'description': fields.text('Job Description'), 'requirements': fields.text('Requirements'), 'department_id': fields.many2one('hr.department', 'Department'), 'company_id': fields.many2one('res.company', 'Company'), - 'state': fields.selection([('open', 'In Position'),('recruit', 'In Recruitement'),('old', 'Old')], 'Status', readonly=True, required=True), + 'state': fields.selection([('open', 'In Position'), ('recruit', 'In Recruitement')], 'Status', readonly=True, required=True, + help="By default 'In position', set it to 'In Recruitment' if recruitment process is going on for this job position."), } _defaults = { 'expected_employees': 1, @@ -128,10 +131,6 @@ class hr_job(osv.osv): context = {} return {'value': {'expected_employees': no_of_recruitment + no_of_employee}} - def job_old(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state': 'old', 'no_of_recruitment': 0}) - return True - def job_recruitement(self, cr, uid, ids, *args): for job in self.browse(cr, uid, ids): no_of_recruitment = job.no_of_recruitment == 0 and 1 or job.no_of_recruitment diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index fd527209e12..db85a0f76ef 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -8,9 +8,7 @@ groups="base.group_hr_manager,base.group_hr_user,base.group_user"/> - - - + diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 710c33f12b9..982ea1c4000 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -265,7 +265,7 @@ 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. - diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml index 2cf5a930b4d..753b33fa706 100644 --- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml +++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml @@ -100,7 +100,6 @@ - diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml index c007f2c2509..e6b51958e1c 100644 --- a/addons/hr_expense/report/hr_expense_report_view.xml +++ b/addons/hr_expense/report/hr_expense_report_view.xml @@ -118,7 +118,6 @@ - diff --git a/addons/hr_holidays/board_hr_manager_holidays_view.xml b/addons/hr_holidays/board_hr_manager_holidays_view.xml index 1c7c6280f8b..dfb4924c631 100644 --- a/addons/hr_holidays/board_hr_manager_holidays_view.xml +++ b/addons/hr_holidays/board_hr_manager_holidays_view.xml @@ -3,7 +3,7 @@ - Leaves To Validate + Leaves to Approve ir.actions.act_window hr.holidays form diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 9d8f0b5935e..f5e8ba69e5d 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -76,12 +76,12 @@ class hr_holidays_status(osv.osv): 'name': fields.char('Leave Type', size=64, required=True, translate=True), 'categ_id': fields.many2one('crm.case.categ', 'Meeting', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you set a meeting type, OpenERP will create a meeting in the calendar once a leave is validated.'), 'color_name': fields.selection([('red', 'Red'),('blue','Blue'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color in Report', required=True, help='This color will be used in the leaves summary located in Reporting\Leaves by Departement'), - 'limit': fields.boolean('Allow to Override Limit', help='If you tick this checkbox, the system will allow, for this section, the employees to take more leaves than the available ones.'), + 'limit': fields.boolean('Allow to Override Limit', help='If you select this checkbox, the system allows the employees to take more leaves than the available ones for this type.'), 'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the leave type without removing it."), 'max_leaves': fields.function(_user_left_days, string='Maximum Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'), 'leaves_taken': fields.function(_user_left_days, string='Leaves Already Taken', help='This value is given by the sum of all holidays requests with a negative value.', multi='user_left_days'), 'remaining_leaves': fields.function(_user_left_days, string='Remaining Leaves', help='Maximum Leaves Allowed - Leaves Already Taken', multi='user_left_days'), - 'double_validation': fields.boolean('Apply Double Validation', help="If its True then its Allocation/Request have to be validated by second validator") + 'double_validation': fields.boolean('Apply Double Validation', help="When selected, the Allocation/Leave Requests for this type require a second validation to be approved."), } _defaults = { 'color_name': 'red', @@ -280,6 +280,7 @@ class hr_holidays(osv.osv): 'date': record.date_from, 'end_date': record.date_to, 'date_deadline': record.date_to, + 'leave_id': record.id, } case_id = meeting_obj.create(cr, uid, vals) self._create_resource_leave(cr, uid, [record], context=context) @@ -396,11 +397,11 @@ class hr_holidays(osv.osv): for obj in self.browse(cr, uid, ids): if obj.holiday_status_id.double_validation: self.message_append_note(cr, uid, [obj.id], _('System notification'), - _("The %s request has been validated. A second validation is necessary and is now pending.") + _("The %s request has been approved. A second validation is necessary and is now pending.") % ('leave' if obj.type == 'remove' else 'allocation',), type='notification', context=context) else: self.message_append_note(cr, uid, [obj.id], _('System notification'), - _("The %s request has been validated. The validation process is now over.") + _("The %s request has been approved. The validation process is now over.") % ('leave' if obj.type == 'remove' else 'allocation',), type='notification', context=context) def holidays_valid2_notificate(self, cr, uid, ids, context=None): @@ -516,4 +517,10 @@ class hr_employee(osv.osv): hr_employee() +class crm_meeting(osv.osv): + _inherit = 'crm.meeting' + _columns = { + 'leave_id': fields.many2one('hr.holidays','Leave'), + } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_holidays/hr_holidays_data.xml b/addons/hr_holidays/hr_holidays_data.xml index b312d79c03d..c5045d7b318 100644 --- a/addons/hr_holidays/hr_holidays_data.xml +++ b/addons/hr_holidays/hr_holidays_data.xml @@ -20,7 +20,7 @@ Compensatory Days True - brown + lavender diff --git a/addons/hr_holidays/hr_holidays_report.xml b/addons/hr_holidays/hr_holidays_report.xml index 4c8ec39a1af..14d4cb99562 100644 --- a/addons/hr_holidays/hr_holidays_report.xml +++ b/addons/hr_holidays/hr_holidays_report.xml @@ -3,7 +3,7 @@ + help="Leaves during last month"/> @@ -518,5 +518,14 @@ + + diff --git a/addons/hr_holidays/i18n/hr_holidays.pot b/addons/hr_holidays/i18n/hr_holidays.pot index 76cbd507c0e..eeb4e7b5e27 100644 --- a/addons/hr_holidays/i18n/hr_holidays.pot +++ b/addons/hr_holidays/i18n/hr_holidays.pot @@ -401,8 +401,8 @@ msgstr "" #. module: hr_holidays #: help:hr.holidays.status,double_validation:0 msgid "" -"If its True then its Allocation/Request have to be validated by second " -"validator" +"When selected, the Allocation/Leave Requests for this type require a second " +"validation to be approved." msgstr "" #. module: hr_holidays @@ -767,8 +767,8 @@ msgstr "" #. module: hr_holidays #: help:hr.holidays.status,limit:0 msgid "" -"If you tick this checkbox, the system will allow, for this section, the " -"employees to take more leaves than the available ones." +"If you select this checkbox, the system allows the employees to take more " +"leaves than the available ones for this type." msgstr "" #. module: hr_holidays diff --git a/addons/hr_holidays/report/holidays_summary.xsl b/addons/hr_holidays/report/holidays_summary.xsl index a65425dd0b3..4d83cd9cdc7 100644 --- a/addons/hr_holidays/report/holidays_summary.xsl +++ b/addons/hr_holidays/report/holidays_summary.xsl @@ -149,9 +149,9 @@ - Off-Days' Summary + Leaves Summary - Analyze from to of the holidays. + Analyze from to of the leaves. 0.7cm,5.0cm @@ -236,7 +236,7 @@ Color - Holiday Type + Leave Type diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index d756dfe6dfd..8a782075853 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -106,6 +106,10 @@ class report_custom(report_rml): eom = som+datetime.timedelta(59) day_diff=eom-som + name = '' + if len(data['form'].get('emp', ())) == 1: + name = obj_emp.read(cr, uid, data['form']['emp'][0], ['name'])['name'] + if data['form']['holiday_type']!='both': type=data['form']['holiday_type'] if data['form']['holiday_type']=='Confirmed': @@ -113,11 +117,12 @@ class report_custom(report_rml): else: holiday_type=('validate') else: - type="Confirmed and Validated" + type="Confirmed and Approved" holiday_type=('confirm','validate') date_xml.append('%s\n'% (str(rml_obj.formatLang(som.strftime("%Y-%m-%d"),date=True)))) date_xml.append('%s\n' %(str(rml_obj.formatLang(eom.strftime("%Y-%m-%d"),date=True)))) date_xml.append('%s'%(type)) + date_xml.append('%s'%(name)) # date_xml=[] for l in range(0,len(legend)): diff --git a/addons/hr_holidays/test/hr_holidays_report.yml b/addons/hr_holidays/test/hr_holidays_report.yml index 29b6b8c36cd..854ad34d5ff 100644 --- a/addons/hr_holidays/test/hr_holidays_report.yml +++ b/addons/hr_holidays/test/hr_holidays_report.yml @@ -5,7 +5,7 @@ import time ctx={} ctx.update({'model': 'hr.department','active_ids': [ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')]}) - data_dict = {'date_from': time.strftime('%Y-%m-01'), 'depts' : [(6,0,[ref('hr.dep_sales')])],'holiday_type' : 'Validated'} + data_dict = {'date_from': time.strftime('%Y-%m-01'), 'depts' : [(6,0,[ref('hr.dep_sales')])],'holiday_type' : 'Approved'} from tools import test_reports test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_dept',wiz_data=data_dict, context=ctx, our_module='hr_holidays') @@ -16,7 +16,7 @@ import time ctx={} ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')]}) - data_dict = {'date_from': time.strftime('%Y-%m-01'), 'emp' : [(6,0,[ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')])],'holiday_type' : 'Validated'} + data_dict = {'date_from': time.strftime('%Y-%m-01'), 'emp' : [(6,0,[ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')])],'holiday_type' : 'Approved'} from tools import test_reports test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_employee',wiz_data=data_dict, context=ctx, our_module='hr_holidays') diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py index f21dca92393..53f981424d2 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py +++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py @@ -26,16 +26,16 @@ from tools.translate import _ class hr_holidays_summary_dept(osv.osv_memory): _name = 'hr.holidays.summary.dept' - _description = 'HR Holidays Summary Report By Department' + _description = 'HR Leaves Summary Report By Department' _columns = { 'date_from': fields.date('From', required=True), 'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'), - 'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Leave Type', required=True) + 'holiday_type': fields.selection([('Approved','Approved'),('Confirmed','Confirmed'),('both','Both Approved and Confirmed')], 'Leave Type', required=True) } _defaults = { 'date_from': lambda *a: time.strftime('%Y-%m-01'), - 'holiday_type': 'Validated' + 'holiday_type': 'Approved' } def print_report(self, cr, uid, ids, context=None): diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml b/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml index 12cb3ceeb0d..72844a58ccb 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml +++ b/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml @@ -7,7 +7,7 @@ hr.holidays.summary.dept form -
+
- - - - -