test-addons-11/project_timesheet_matrix/models/project_project.py

20 lines
562 B
Python

from odoo import models, fields, api
class ProjectProject(models.Model):
_inherit = "project.project"
@api.multi
def open_timesheets_matrix(self):
wiz = self.env['project.timesheet.matrix.wiz'].create({})
return {
'name': 'Edit timesheets',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'project.timesheet.matrix.wiz',
'target': 'new',
'res_id': wiz.id,
'context': self.env.context,
}