[MOV] website_rating_project(_issue): Rename module and remove issues integration

This commit is contained in:
Yannick Tivisse
2017-08-07 11:24:51 +02:00
parent e7c470ff03
commit 1b4f2fbe9c
62 changed files with 18 additions and 26 deletions
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Website Rating Project Issue',
'name': 'Website Rating Project',
'version': '0.1',
'category': 'Project',
'complexity': 'easy',
'description': """
This module display project customer satisfaction on your website.
==================================================================================================
==================================================================
""",
'depends': [
'website_project_issue',
'rating_project_issue'
'website_project',
'rating_project'
],
'data': [
'views/website_rating_project.xml',
@@ -15,7 +15,7 @@ class WebsiteRatingProject(http.Controller):
def index(self, **kw):
projects = request.env['project.project'].sudo().search([('rating_status', '!=', 'no'), ('website_published', '=', True)])
values = {'projects': projects}
return request.render('website_rating_project_issue.index', values)
return request.render('website_rating_project.index', values)
@http.route(['/project/rating/<int:project_id>'], type='http', auth="public", website=True)
def page(self, project_id=None, **kw):
@@ -28,12 +28,11 @@ class WebsiteRatingProject(http.Controller):
values = {
'project': project,
'task_data': self._calculate_rating(project.id, "project.task"),
'issue_data': self._calculate_rating(project.id, "project.issue"),
}
return request.render('website_rating_project_issue.project_rating_page', values)
return request.render('website_rating_project.project_rating_page', values)
def _calculate_rating(self, project_id, model_name):
# Calculate rating for Tasks and Issues
# Calculate rating for Tasks
records = request.env[model_name].sudo().search([('project_id', '=', project_id)])
domain = [('res_model', '=', model_name), ('res_id', 'in', records.ids), ('consumed', '=', True)]
ratings = request.env['rating.rating'].search(domain, order="id desc", limit=100)

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -1,5 +1,5 @@
<odoo>
<record id="edit_project_inherit_website_rating_project_issue" model="ir.ui.view">
<record id="project_project_view_form" model="ir.ui.view">
<field name="name">project.project.inherit.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
@@ -2,21 +2,21 @@
<odoo>
<data>
<!-- CSS Style Bundle -->
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Rating Project Issue Assets">
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Rating Project Assets">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/website_rating_project_issue/static/src/css/website_rating_project_issue.css"/>
<link rel="stylesheet" href="/website_rating_project/static/src/css/website_rating_project.css"/>
</xpath>
</template>
<!-- Layout add footer -->
<template id="header_footer_custom" inherit_id="website.footer_default" name="Project Issue Rating Footer Link">
<template id="header_footer_custom" inherit_id="website.footer_default" name="Project Rating Footer Link">
<xpath expr="//ul[@id='products']" position="inside">
<li><a href="/project/rating/">Project Customer Satisfaction</a></li>
</xpath>
</template>
<!-- Page : List of project -->
<template id="index" name="Project Issue Rating List">
<template id="index" name="Project Rating List">
<t t-call="website.layout">
<t t-set="additional_title">Project Satisfaction</t>
<div id="wrap">
@@ -45,10 +45,6 @@
<h2><t t-esc="len(project.task_ids)"/></h2>
<p><t t-esc="project.label_tasks"/></p>
</div>
<div t-if="project.use_issues" class="col-md-6 text-center">
<h2><t t-esc="len(project.issue_ids)"/></h2>
<p><t t-esc="project.label_issues"/></p>
</div>
</div>
</div>
<div class="caption">
@@ -70,7 +66,7 @@
</template>
<!-- Page : Rating of a particular project -->
<template id="project_rating_data" name="Project Issue Rating Page">
<template id="project_rating_data" name="Project Rating Page">
<div class="progress">
<div class="progress-bar progress-bar-success" t-attf-style="width: #{stats[duration][10]}%;" title="Happy">
<t t-esc="int(stats[duration][10])"/>%
@@ -91,19 +87,19 @@
<h5>Last 7 days</h5>
<t t-set="duration" t-value="7"/>
<t t-set="stats" t-value="data['stats']"/>
<t t-call="website_rating_project_issue.project_rating_data"/>
<t t-call="website_rating_project.project_rating_data"/>
</div>
<div class="col-sm-4">
<h5>Last 30 days</h5>
<t t-set="duration" t-value="30"/>
<t t-set="stats" t-value="data['stats']"/>
<t t-call="website_rating_project_issue.project_rating_data"/>
<t t-call="website_rating_project.project_rating_data"/>
</div>
<div class="col-sm-4">
<h5>Last 3 months</h5>
<t t-set="duration" t-value="90"/>
<t t-set="stats" t-value="data['stats']"/>
<t t-call="website_rating_project_issue.project_rating_data"/>
<t t-call="website_rating_project.project_rating_data"/>
</div>
</div>
@@ -113,7 +109,7 @@
</t>
</template>
<template id="project_rating_page" name="Project Issue Rating Page">
<template id="project_rating_page" name="Project Rating Page">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure"/>
@@ -130,10 +126,7 @@
<div class="col-md-8">
<t t-set="type" t-value="'Tasks'"/>
<t t-set="data" t-value="task_data"/>
<t t-call="website_rating_project_issue.project_data_satisfaction"/>
<t t-set="type" t-value="'Issues'"/>
<t t-set="data" t-value="issue_data"/>
<t t-call="website_rating_project_issue.project_data_satisfaction"/>
<t t-call="website_rating_project.project_data_satisfaction"/>
</div>
</div>
</div>