In OpenERP first we inherit to the rating.rating object and then we create the kanban. if the auto_validation_kanban_state is activated then apply the modification of the kanban state according to the given rating. And then return the action to see all the rating about the all sort of activity of the project like as task and issue.
Use this function show in given below
def kanban_rating(self, rate, res_model=None, res_id=None, token=None):
rating = super(Rating, self).apply_rating(rate, res_model, res_id, token)
if rating.res_model == 'project.task':
task = self.env[rating.res_model].sudo().browse(rating.res_id)
if task.stage_id.auto_validation_kanban_state:
if rating.rating > 5:
task.write({'kanban_state' : 'done'})
else:
task.write({'kanban_state' : 'blocked'})
return rating
0 Comment(s)