mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
15 lines
524 B
Python
15 lines
524 B
Python
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class HrAttendance(models.Model):
|
|
_inherit = 'hr.attendance'
|
|
|
|
payslip_id = fields.Many2one('hr.payslip', string="Payslip", readonly=True, ondelete='set null')
|
|
|
|
def unlink(self):
|
|
attn_with_payslip = self.filtered(lambda a: a.payslip_id)
|
|
attn_with_payslip.write({'payslip_id': False})
|
|
return super(HrAttendance, self - attn_with_payslip).unlink()
|