Merge pull request #2157 from expsa/manar_dev_hr_20_1

UPDATE exp_payroll_custom
This commit is contained in:
Manar416 2025-01-20 10:58:26 +02:00 committed by GitHub
commit 889f0d9321
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 40 deletions

View File

@ -2961,10 +2961,7 @@ class HrPayslipRun(models.Model):
def transfer(self):
list_of_vals = []
attachments = self.env['ir.attachment'].search([
('res_model', '=', 'hr.payslip.run'),
('res_id', 'in', self.ids)
])
if self.salary_scale.transfer_type == 'all':
total_of_list = []
for line in self.slip_ids:
@ -3051,17 +3048,12 @@ class HrPayslipRun(models.Model):
# 'date': fields.Date.context_today(self),
'date': self.date_end,
'ref': self.name,
'line_ids': [(0, 0, item) for item in record_final_item]
'line_ids': [(0, 0, item) for item in record_final_item],
'res_model': 'hr.payslip.run',
'res_id': self.id
})
self.move_id = move.id
for attachment in attachments:
new_attachment = self.env['ir.attachment'].create({
'name': attachment.name,
'type': attachment.type,
'datas': attachment.datas,
'res_model': 'account.move',
'res_id': move.id,
})
########################## per_analytic_account ###########
@ -3176,17 +3168,12 @@ class HrPayslipRun(models.Model):
'date': self.date_end,
'ref': self.name,
'line_ids': [(0, 0, item) for item in record_final_item]
'line_ids': [(0, 0, item) for item in record_final_item],
'res_model': 'hr.payslip.run',
'res_id': self.id
})
self.move_id = move.id
for attachment in attachments:
new_attachment = self.env['ir.attachment'].create({
'name': attachment.name,
'type': attachment.type,
'datas': attachment.datas,
'res_model': 'account.move',
'res_id': move.id,
})
# import pdb
# pdb.set_trace()
@ -3271,17 +3258,11 @@ class HrPayslipRun(models.Model):
# 'date': fields.Date.context_today(self),
'date': self.date_end,
'ref': line.name,
'line_ids': [(0, 0, item) for item in new_record_list]
'line_ids': [(0, 0, item) for item in new_record_list],
'res_model': 'hr.payslip.run',
'res_id': self.id
})
line.move_id = move.id
for attachment in attachments:
new_attachment = self.env['ir.attachment'].create({
'name': attachment.name,
'type': attachment.type,
'datas': attachment.datas,
'res_model': 'account.move',
'res_id': move.id,
})
else:
bank_id = ''
@ -3439,17 +3420,11 @@ class HrPayslipRun(models.Model):
# 'date': fields.Date.context_today(self),
'date': self.date_end,
'ref': bank_id,
'line_ids': [(0, 0, item) for item in record_final_item]
'line_ids': [(0, 0, item) for item in record_final_item],
'res_model': 'hr.payslip.run',
'res_id': self.id
})
line.move_id = move.id
for attachment in attachments:
new_attachment = self.env['ir.attachment'].create({
'name': attachment.name,
'type': attachment.type,
'datas': attachment.datas,
'res_model': 'account.move',
'res_id': move.id,
})
for line in self.slip_ids:
payslip = self.env['hr.payslip'].search([('state', '=', line.state)])