this is when i created the new record:
def action_launchplan(self):
for i in self.plan_id.plan_activity_type_ids:
self.env['hr.plan.activity'].create({
'employee_id': self.employee_id.id,
'activity_type_id': i.id,
'date':date.today(),
'plan_id':self.plan_id.id,
'line_ids': [(0,0, {
'name': i.name,
'description': i.description,
})for i in i.line_ids]
})
this is when i wanted to opened a window after a new record has been created:
def open_plans(self):
self.ensure_one()
return {
'name': 'Plans',
'type': 'ir.actions.act_window',
'view_mode': 'tree,form',
'target': 'current',
'res_model': 'hr.plan.activity',
'context': {'create': False, 'delete': False, 'edit': False,},
'domain': [('id','in', self.plan_line_ids.ids)],
}
This is the actual Function:
def action_launch(self):
self.action_launchplan()
self.employee_id.open_plans()
how do i get the current record id ?