diff --git a/hr_payroll_payment/__manifest__.py b/hr_payroll_payment/__manifest__.py index 15411b4a..5281bcac 100755 --- a/hr_payroll_payment/__manifest__.py +++ b/hr_payroll_payment/__manifest__.py @@ -38,6 +38,7 @@ Passes original Payroll Accounting tests and additional ones for gouping behavio 'depends': [ 'hr_payroll_account', 'account_batch_payment', + 'hibou_professional', ], 'data': [ #'wizard/hr_payroll_register_payment_views.xml', diff --git a/hr_payroll_payment/models/hr_payslip.py b/hr_payroll_payment/models/hr_payslip.py index 2b961493..0de752a3 100644 --- a/hr_payroll_payment/models/hr_payslip.py +++ b/hr_payroll_payment/models/hr_payslip.py @@ -139,12 +139,13 @@ class HrPayslip(models.Model): # in # payslips_to_post} # Hibou Customization: group with journal itself so that journal behavior can be derived. + # Hibou Customization: prefer slip's `date` over end of month slip_mapped_data = { - slip.struct_id.journal_id: {fields.Date().end_of(slip.date_to, 'month'): self.env['hr.payslip']} for slip + slip.struct_id.journal_id: {slip.date or fields.Date().end_of(slip.date_to, 'month'): self.env['hr.payslip']} for slip in payslips_to_post} for slip in payslips_to_post: - slip_mapped_data[slip.struct_id.journal_id][fields.Date().end_of(slip.date_to, 'month')] |= slip + slip_mapped_data[slip.struct_id.journal_id][slip.date or fields.Date().end_of(slip.date_to, 'month')] |= slip for journal in slip_mapped_data: # For each journal_id. """