summaryrefslogtreecommitdiff
path: root/addons/website_project/models
diff options
context:
space:
mode:
authorBenjamin Frantzen (bfr) <bfr@odoo.com>2019-12-18 13:45:38 +0000
committerYannick Tivisse <yti@odoo.com>2020-05-08 12:17:20 +0000
commite4a4ffb974ccde1842e1b2389450718f8576ad5b (patch)
tree6159873058286c65a3a3bfb5a48f2ef5ffbf7565 /addons/website_project/models
parentf427a38c4e0dcd63d086706ad66a3e5570fbf0aa (diff)
[IMP] customer ratings flow improvements
- Rename the 'Use Rating on Project' feature into 'Customer Ratings' - Rename the 'Set Email Template to Stages' link to 'Set a Rating Email Template on Stages' - Add an optional list view for the Stages menu - display warning if the rating_template_id field is set and if one of the selected project_ids doesn't have the rating_status field set to true - Project form view revamp - rename the '% on tasks' stat button into 'Customer Satisfaction' - Remove the 'no option' for the rating frequency field because it is required - project form : Add a 'Go to Website' stat button - Project dashboard: remove the 'Customer Ratings' menu item in more - Ratings page: the 'Last 30 days' filter include ratings from today - remove the Appointment / Helpdesk Customer Satisfaction / Live Support menu items TASK ID : 1251
Diffstat (limited to 'addons/website_project/models')
-rw-r--r--addons/website_project/models/__init__.py4
-rw-r--r--addons/website_project/models/project.py23
2 files changed, 27 insertions, 0 deletions
diff --git a/addons/website_project/models/__init__.py b/addons/website_project/models/__init__.py
new file mode 100644
index 00000000000..527e2954c06
--- /dev/null
+++ b/addons/website_project/models/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import project
diff --git a/addons/website_project/models/project.py b/addons/website_project/models/project.py
new file mode 100644
index 00000000000..ded92b699a2
--- /dev/null
+++ b/addons/website_project/models/project.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models
+
+
+class Project(models.Model):
+ _name = 'project.project'
+ _inherit = ['project.project', 'website.published.mixin']
+
+ def action_view_all_rating(self):
+ if self.website_published:
+ return self.open_website_url()
+ return super(Project, self).action_view_all_rating()
+
+ def open_website_url(self):
+ """ return the action to see all the rating of the project, and activate default filters """
+ return {
+ 'type': 'ir.actions.act_url',
+ 'name': "Redirect to the Website Project Rating Page",
+ 'target': 'self',
+ 'url': "/project/rating/%s" % (self.id)
+ }