I am facing a problem this.get_critical_paths(events).done is not a function
When I tried debugging the problem I can see the
console.log(paths)
Then I got this
Unhandled Promise Rejection: ReferenceError: Can't find variable: paths
I am not sure what to do to fix the problem.
This is the code that should return the paths
var
@api.model
def calc_critical_paths(self, project_ids):
res = {}
projects = self.env['project.project'].browse(project_ids)
for project in projects:
res.update({
project.id: self.calc_critical_path(project)
})
return res
I am trying to upgrade The project timeline critical path
if (this.modelName === 'project.task') {
this.get_critical_paths(events).done(function(paths) {
this.critical_paths = paths;
this.draw_canvas();
}.bind(this));
}