28 lines
760 B
Python
28 lines
760 B
Python
from odoo import models, fields, api
|
|
|
|
|
|
class ProjectProject(models.Model):
|
|
_inherit = 'project.project'
|
|
|
|
def open_dashboard(self):
|
|
self.ensure_one()
|
|
return {
|
|
'type': 'ir.actions.act_window',
|
|
'name': 'Project Dashboard',
|
|
'res_model': 'project.project',
|
|
'view_mode': 'form',
|
|
'view_type': 'form',
|
|
'res_id': self.id,
|
|
'target': 'new',
|
|
'views': [(False, 'dashboard')],
|
|
}
|
|
|
|
@api.model
|
|
def get_dashboard_data(self, project_id):
|
|
# Return data for charts and KPIs
|
|
return {
|
|
'task_count': 42,
|
|
'completed_tasks': 35,
|
|
'timeline_data': [...],
|
|
'resource_data': [...],
|
|
} |