[FIX] hr_payroll: Use date_to_str on work entries generation
Purpose ======= This aim to avoid sending a datetime that will be converted into UTC and that way have a wrong date set on the payslip.
This commit is contained in:
@@ -55,7 +55,7 @@ odoo.define('hr_payroll.WorkEntryControllerMixin', function(require) {
|
||||
this._rpc({
|
||||
model: 'hr.employee',
|
||||
method: 'generate_work_entry',
|
||||
args: [time.datetime_to_str(this.firstDay), time.datetime_to_str(this.lastDay)],
|
||||
args: [time.date_to_str(this.firstDay), time.date_to_str(this.lastDay)],
|
||||
}).then(function () {
|
||||
self.reload();
|
||||
});
|
||||
@@ -64,8 +64,8 @@ odoo.define('hr_payroll.WorkEntryControllerMixin', function(require) {
|
||||
_generatePayslips: function () {
|
||||
this.do_action('hr_payroll.action_generate_payslips_from_work_entries', {
|
||||
additional_context: {
|
||||
default_date_start: time.datetime_to_str(this.firstDay),
|
||||
default_date_end: time.datetime_to_str(this.lastDay),
|
||||
default_date_start: time.date_to_str(this.firstDay),
|
||||
default_date_end: time.date_to_str(this.lastDay),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
@@ -74,7 +74,6 @@ class TestPayslipMultiContract(TestPayslipContractBase):
|
||||
start = datetime.strptime('2015-11-05 07:00:00', '%Y-%m-%d %H:%M:%S')
|
||||
end = datetime.strptime('2015-12-15 18:00:00', '%Y-%m-%d %H:%M:%S')
|
||||
self.contract_cdi.write({'date_start': datetime.strptime('2015-12-30', '%Y-%m-%d').date()})
|
||||
print(self.contract_cdi.date_start, 'test')
|
||||
# begins during contract, ends after contract
|
||||
leave = self.create_leave(start, end)
|
||||
leave.action_approve()
|
||||
|
||||
Reference in New Issue
Block a user