I an needing a more complete version of project templates, I have had a look at the OCA module and they are only copying the tasks, I have tried using the below code:
def action_create_project_from_template(self):
template_id = self.signage_project_template_id
default ={}
default['name'] = self.name
#default['partner_id'] = self.partner_id
super(Project, template_id).copy(default)
return {
'view_mode': 'form',
'res_model': 'project.project',
'res_id': self.id,
'type': 'ir.actions.act_window',
'context': self._context
}
Which I am calling from "project.project.view.form.simplified" which partly works, I do get the duplicate copy but because that form already created a project I end up with two projects.
Odoo self hosted v16
Is there a simple option to prevent the default action or a better approach altogether?
Edit:
project.project.view.form.simplified is still calling the standard new project at the same time I am calling copy.
For clarity the main goal here is to be able to duplicate a project template whilst adding customer and name, all from the Kanban view.