From 3a2e4c1d7da84b780b6244e9caed0968f0d3be6a Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Mon, 8 May 2017 14:53:53 +0200 Subject: [PATCH] [FIX] hr_contract,hr_payroll,...: Update tooltips on contract and job fields --- addons/hr_contract/models/hr_contract.py | 11 +++-- addons/hr_payroll/models/hr_contract.py | 5 ++- addons/hr_recruitment/models/hr_job.py | 3 +- .../models/l10n_be_hr_payroll.py | 45 ++++++++++++------- .../models/hr_contract.py | 5 ++- 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py index 819fa261d10..47bbfcd4dff 100644 --- a/addons/hr_contract/models/hr_contract.py +++ b/addons/hr_contract/models/hr_contract.py @@ -58,13 +58,16 @@ class Contract(models.Model): department_id = fields.Many2one('hr.department', string="Department") type_id = fields.Many2one('hr.contract.type', string="Contract Type", required=True, default=lambda self: self.env['hr.contract.type'].search([], limit=1)) job_id = fields.Many2one('hr.job', string='Job Position') - date_start = fields.Date('Start Date', required=True, default=fields.Date.today) - date_end = fields.Date('End Date') - trial_date_end = fields.Date('End of Trial Period') + date_start = fields.Date('Start Date', required=True, default=fields.Date.today, + help="Start date of the contract.") + date_end = fields.Date('End Date', + help="End date of the contract (if it's a fixed-term contract).") + trial_date_end = fields.Date('End of Trial Period', + help="End date of the trial period (if there is one).") resource_calendar_id = fields.Many2one( 'resource.calendar', 'Working Schedule', default=lambda self: self.env['res.company']._company_default_get().resource_calendar_id.id) - wage = fields.Monetary('Wage', digits=(16, 2), required=True, help="The monthly gross wage of the employee.") + wage = fields.Monetary('Wage', digits=(16, 2), required=True, help="Employee's monthly gross wage.") advantages = fields.Text('Advantages') notes = fields.Text('Notes') state = fields.Selection([ diff --git a/addons/hr_payroll/models/hr_contract.py b/addons/hr_payroll/models/hr_contract.py index 054782c406d..6aebe4134de 100644 --- a/addons/hr_payroll/models/hr_contract.py +++ b/addons/hr_payroll/models/hr_contract.py @@ -21,8 +21,9 @@ class HrContract(models.Model): ('weekly', 'Weekly'), ('bi-weekly', 'Bi-weekly'), ('bi-monthly', 'Bi-monthly'), - ], string='Scheduled Pay', index=True, default='monthly') - resource_calendar_id = fields.Many2one(required=True) + ], string='Scheduled Pay', index=True, default='monthly', + help="Defines the frequency of the wage payment.") + resource_calendar_id = fields.Many2one(required=True, help="Employee's working schedule.") @api.multi def get_all_structures(self): diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index e7648bcfe75..0c6c643b118 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -20,7 +20,8 @@ class Job(models.Model): 'hr.employee', related='department_id.manager_id', string="Department Manager", readonly=True, store=True) user_id = fields.Many2one('res.users', "Recruitment Responsible", track_visibility='onchange') - hr_responsible_id = fields.Many2one('res.users', "HR Responsible", track_visibility='onchange') + hr_responsible_id = fields.Many2one('res.users', "HR Responsible", track_visibility='onchange', + help="Person responsible of validating the employee's contracts.") document_ids = fields.One2many('ir.attachment', compute='_compute_document_ids', string="Applications") documents_count = fields.Integer(compute='_compute_document_ids', string="Documents") alias_id = fields.Many2one( diff --git a/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py b/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py index 77665fe5d55..72fbc801345 100644 --- a/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py +++ b/addons/l10n_be_hr_payroll/models/l10n_be_hr_payroll.py @@ -13,17 +13,22 @@ class HrContract(models.Model): ('company_car', 'Company car'), ('public_transport', 'Public Transport'), ('others', 'Other'), - ], string="Transport", default='company_car') + ], string="Transport", default='company_car', + help="Transport mode the employee uses to go to work.") car_atn = fields.Monetary(string='ATN Company Car') public_transport_employee_amount = fields.Monetary('Paid by the employee (Monthly)') - thirteen_month = fields.Monetary(compute='_compute_holidays_advantages', string='13th Month') - double_holidays = fields.Monetary(compute='_compute_holidays_advantages', string='Double holidays') + thirteen_month = fields.Monetary(compute='_compute_holidays_advantages', string='13th Month', + help="Yearly gross amount the employee receives as 13th month bonus.") + double_holidays = fields.Monetary(compute='_compute_holidays_advantages', string='Double holidays', + help="Yearly gross amount the employee receives as double holidays bonus.") warrant_value_employee = fields.Monetary(compute='_compute_warrants_cost', string="Warrant value for the employee") # Employer costs fields final_yearly_costs = fields.Monetary(compute='_compute_final_yearly_costs', readonly=False, - string='Total Employee Cost', groups="hr.group_hr_manager") - monthly_yearly_costs = fields.Monetary(compute='_compute_monthly_yearly_costs', string='Monthly Equivalent Cost', readonly=True) + string='Total Employee Cost', groups="hr.group_hr_manager", + help="Total yearly cost of the employee for the employer.") + monthly_yearly_costs = fields.Monetary(compute='_compute_monthly_yearly_costs', string='Monthly Equivalent Cost', readonly=True, + help="Total monthly cost of the employee for the employer.") ucm_insurance = fields.Monetary(compute='_compute_ucm_insurance', string="Social Secretary Costs") social_security_contributions = fields.Monetary(compute='_compute_social_security_contributions', string="Social Security Contributions") yearly_cost_before_charges = fields.Monetary(compute='_compute_yearly_cost_before_charges', string="Yearly Costs Before Charges") @@ -37,31 +42,39 @@ class HrContract(models.Model): # Advantages commission_on_target = fields.Monetary(string="Commission on Target", - default=lambda self: self.get_attribute('commission_on_target', 'default_value')) + default=lambda self: self.get_attribute('commission_on_target', 'default_value'), + help="Monthly gross amount that the employee receives if the target is reached.") fuel_card = fields.Monetary(string="Fuel Card", - default=lambda self: self.get_attribute('fuel_card', 'default_value')) + default=lambda self: self.get_attribute('fuel_card', 'default_value'), + help="Monthly amount the employee receives on his fuel card.") internet = fields.Monetary(string="Internet", default=lambda self: self.get_attribute('internet', 'default_value'), - help="Your internet subscription will be paid up to this amount.") + help="The employee's internet subcription will be paid up to this amount.") representation_fees = fields.Monetary(string="Representation Fees", - default=lambda self: self.get_attribute('representation_fees', 'default_value')) + default=lambda self: self.get_attribute('representation_fees', 'default_value'), + help="Monthly net amount the employee receives to cover his representation fees.") mobile = fields.Monetary(string="Mobile", default=lambda self: self.get_attribute('mobile', 'default_value'), - help="Your mobile subscription will be paid up to this amount.") + help="The employee's mobile subscription will be paid up to this amount.") mobile_plus = fields.Monetary(string="International Communication", default=lambda self: self.get_attribute('mobile_plus', 'default_value'), - help="Your international mobile subscription will be paid up to this amount.") + help="The employee's mobile subscription for international communication will be paid up to this amount.") meal_voucher_amount = fields.Monetary(string="Meal Vouchers", - default=lambda self: self.get_attribute('meal_voucher_amount', 'default_value')) + default=lambda self: self.get_attribute('meal_voucher_amount', 'default_value'), + help="Amount the employee receives in the form of meal vouchers per worked day.") holidays = fields.Float(string="Holidays", - default=lambda self: self.get_attribute('holidays', 'default_value')) + default=lambda self: self.get_attribute('holidays', 'default_value'), + help="Number of days of paid leaves the employee gets per year.") holidays_editable = fields.Boolean(string="Editable Holidays", default=True) holidays_compensation = fields.Monetary(compute='_compute_holidays_compensation', string="Holidays Compensation") wage_with_holidays = fields.Monetary(compute='_compute_wage_with_holidays', sting="Wage update with holidays retenues") - additional_net_amount = fields.Monetary(string="Net Supplements") - retained_net_amount = fields.Monetary(sting="Net Retained") + additional_net_amount = fields.Monetary(string="Net Supplements", + help="Monthly net amount the employee receives.") + retained_net_amount = fields.Monetary(sting="Net Retained", + help="Monthly net amount that is retained on the employee's salary.") eco_checks = fields.Monetary("Eco Vouchers", - default=lambda self: self.get_attribute('eco_checks', 'default_value')) + default=lambda self: self.get_attribute('eco_checks', 'default_value'), + help="Yearly amount the employee receives in the form of eco vouchers.") @api.depends('holidays', 'wage') def _compute_wage_with_holidays(self): diff --git a/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py b/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py index 4c62264c781..9c13d2a396f 100644 --- a/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py +++ b/addons/l10n_be_hr_payroll_fleet/models/hr_contract.py @@ -7,9 +7,10 @@ from odoo import api, fields, models class HrContract(models.Model): _inherit = 'hr.contract' - car_id = fields.Many2one('fleet.vehicle', string='Car', + car_id = fields.Many2one('fleet.vehicle', string='Company Car', domain=lambda self: self._get_available_cars_domain(), - default=lambda self: self.env['fleet.vehicle'].search([('driver_id', '=', self.employee_id.address_home_id.id)], limit=1)) + default=lambda self: self.env['fleet.vehicle'].search([('driver_id', '=', self.employee_id.address_home_id.id)], limit=1), + help="Employee's company car.") car_atn = fields.Float(compute='_compute_car_atn_and_costs', string='ATN Company Car') company_car_total_depreciated_cost = fields.Float(compute='_compute_car_atn_and_costs') available_cars_amount = fields.Integer(compute='_compute_available_cars_amount', string='Number of available cars')