from odoo import _, fields, models class HrPayslipRun(models.Model): _inherit = 'hr.payslip.run' move_id = fields.Many2one( 'account.move', string='Batch Accounting Entry', readonly=True, copy=False, ondelete='set null', ) move_state = fields.Selection( related='move_id.state', string='Move State', ) def action_open_move(self): self.ensure_one() if not self.move_id: return False return { 'type': 'ir.actions.act_window', 'name': _('Journal Entry'), 'res_model': 'account.move', 'view_mode': 'form', 'res_id': self.move_id.id, }