diff --git a/hr_payroll_community/__manifest__.py b/hr_payroll_community/__manifest__.py index 7eb2ee5d2..daa3c2172 100644 --- a/hr_payroll_community/__manifest__.py +++ b/hr_payroll_community/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Odoo13 Payroll', 'category': 'Generic Modules/Human Resources', - 'version': '13.0.1.2.1', + 'version': '13.0.1.3.2', 'author': 'Odoo SA,Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/hr_payroll_community/models/hr_contract.py b/hr_payroll_community/models/hr_contract.py index 714410d27..7fda5b4db 100644 --- a/hr_payroll_community/models/hr_contract.py +++ b/hr_payroll_community/models/hr_contract.py @@ -23,12 +23,12 @@ class HrContract(models.Model): ], 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.") - hra = fields.Integer(string="HRA", help="House rent allowance") - travel_allowance = fields.Integer(string="Travel Allowance", help="Travel allowance") - da = fields.Integer(string="DA", help="Dearness allowance") - meal_allowance = fields.Integer(string="Meal Allowance", help="Meal allowance") - medical_allowance = fields.Integer(string="Medical Allowance", help="Medical allowance") - other_allowance = fields.Integer(string="Other Allowance", help="Other allowances") + hra = fields.Monetary(string='HRA', tracking=True, help="House rent allowance.") + travel_allowance = fields.Monetary(string="Travel Allowance", help="Travel allowance") + da = fields.Monetary(string="DA", help="Dearness allowance") + meal_allowance = fields.Monetary(string="Meal Allowance", help="Meal allowance") + medical_allowance = fields.Monetary(string="Medical Allowance", help="Medical allowance") + other_allowance = fields.Monetary(string="Other Allowance", help="Other allowances") def get_all_structures(self): """ diff --git a/hr_payroll_community/models/hr_employee.py b/hr_payroll_community/models/hr_employee.py index 97efe8e13..e9e7f84d0 100644 --- a/hr_payroll_community/models/hr_employee.py +++ b/hr_payroll_community/models/hr_employee.py @@ -8,8 +8,13 @@ class HrEmployee(models.Model): _description = 'Employee' slip_ids = fields.One2many('hr.payslip', 'employee_id', string='Payslips', readonly=True, help="payslip") - payslip_count = fields.Integer(compute='_compute_payslip_count', string='Payslip Count', groups="hr_payroll_community.group_hr_payroll_user") + payslip_count = fields.Integer(compute='_compute_payslip_count', string='Payslip Count') def _compute_payslip_count(self): + payslip_data = self.env['hr.payslip'].sudo().read_group([('employee_id', 'in', self.ids)], + ['employee_id'], ['employee_id']) + result = dict((data['employee_id'][0], data['employee_id_count']) for data in payslip_data) for employee in self: - employee.payslip_count = len(employee.slip_ids) + employee.payslip_count = result.get(employee.id, 0) + + diff --git a/hr_payroll_community/static/description/web_icons.png b/hr_payroll_community/static/description/web_icons.png new file mode 100644 index 000000000..35f86536f Binary files /dev/null and b/hr_payroll_community/static/description/web_icons.png differ diff --git a/hr_payroll_community/views/hr_contract_views.xml b/hr_payroll_community/views/hr_contract_views.xml index be9c21981..78d64b027 100644 --- a/hr_payroll_community/views/hr_contract_views.xml +++ b/hr_payroll_community/views/hr_contract_views.xml @@ -3,7 +3,7 @@ + web_icon="hr_payroll_community,static/description/web_icons.png"/> @@ -17,7 +17,7 @@ - + @@ -60,17 +60,42 @@ - - - - - - - - - - + + diff --git a/hr_payroll_community/views/hr_employee_views.xml b/hr_payroll_community/views/hr_employee_views.xml index f99ba6bb2..d3354becf 100644 --- a/hr_payroll_community/views/hr_employee_views.xml +++ b/hr_payroll_community/views/hr_employee_views.xml @@ -10,7 +10,7 @@