2019-06-11 21:34:10 +00:00
|
|
|
from odoo import models, fields, api
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectProject(models.Model):
|
|
|
|
_inherit = "project.project"
|
|
|
|
|
2019-06-12 16:44:10 +00:00
|
|
|
@api.multi
|
2019-06-11 21:34:10 +00:00
|
|
|
def open_timesheets_matrix(self):
|
2019-06-12 17:50:21 +00:00
|
|
|
wiz = self.env['project.timesheet.matrix.wiz'].with_context(project_id=self.id).create({})
|
2019-06-11 21:34:10 +00:00
|
|
|
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,
|
|
|
|
}
|