[FIX] hr_payroll_payment: use manually set accounting date on payslip if filled

Odoo EE upstream has functionally the same code, so the help for the field is a lie (currently).
This commit is contained in:
Jared Kipe
2020-10-07 15:19:45 -07:00
parent 55814321c2
commit 99eba6b66d

View File

@@ -139,12 +139,13 @@ class HrPayslip(models.Model):
# in # in
# payslips_to_post} # payslips_to_post}
# Hibou Customization: group with journal itself so that journal behavior can be derived. # 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_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 in
payslips_to_post} payslips_to_post}
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. for journal in slip_mapped_data: # For each journal_id.
""" """