Merge branch 'fix/13.0/hr_payroll_payment__use_slip_date' into '13.0'

fix/13.0/hr_payroll_payment__use_slip_date into 13.0

See merge request hibou-io/hibou-odoo/suite!496
This commit is contained in:
Jared Kipe
2020-10-07 22:25:11 +00:00
2 changed files with 4 additions and 2 deletions

View File

@@ -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',

View File

@@ -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.
"""