summaryrefslogtreecommitdiff
path: root/addons/project/models/project.py
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2017-08-17 09:38:16 +0200
committerjem-odoo <jem@openerp.com>2017-12-12 14:06:29 +0100
commitd7d30f69d78e75cb859ec6b5e70b91d78c6e4eaf (patch)
tree11e537f68c4f71e7afd82cfb9ddccebea9e971da /addons/project/models/project.py
parent93adbdbb208a29b0a61b97a502bbbadb16e8e60a (diff)
[REM] website_rating_project: move feature in project
Displaying the rating of project is moved directly in project module, since it does not depends on website. User may want to display rating of its support project even without website.
Diffstat (limited to 'addons/project/models/project.py')
-rw-r--r--addons/project/models/project.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index c1e802839da..1df6bbad540 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -235,9 +235,11 @@ class Project(models.Model):
"- Periodical Rating: Email will be sent periodically\n\n"
"Don't forget to set up the mail templates on the stages for which you want to get the customer's feedbacks.", default="no", required=True)
rating_status_period = fields.Selection([
- ('daily', 'Daily'), ('weekly', 'Weekly'), ('bimonthly', 'Twice a Month'),
- ('monthly', 'Once a Month'), ('quarterly', 'Quarterly'), ('yearly', 'Yearly')
- ], 'Rating Frequency')
+ ('daily', 'Daily'), ('weekly', 'Weekly'), ('bimonthly', 'Twice a Month'),
+ ('monthly', 'Once a Month'), ('quarterly', 'Quarterly'), ('yearly', 'Yearly')
+ ], 'Rating Frequency')
+
+ portal_show_rating = fields.Boolean('Rating visible publicly', copy=False, oldname='website_published')
_sql_constraints = [
('project_date_greater', 'check(date >= date_start)', 'Error! project start-date must be lower than project end-date.')
@@ -405,6 +407,13 @@ class Project(models.Model):
@api.multi
def action_view_all_rating(self):
""" return the action to see all the rating of the project, and activate default filters """
+ if self.portal_show_rating:
+ return {
+ 'type': 'ir.actions.act_url',
+ 'name': "Redirect to the Website Projcet Rating Page",
+ 'target': 'self',
+ 'url': "/project/rating/%s" % (self.id,)
+ }
action = self.env['ir.actions.act_window'].for_xml_id('project', 'rating_rating_action_view_project_rating')
action['name'] = _('Ratings of %s') % (self.name,)
action_context = safe_eval(action['context']) if action['context'] else {}