[IMP] project : Customer Ratings improvements

- Removal of 'my team's ratings' and the 'my department's ratings'
filters in order to be more consistent with the project.task search view

- UI improvements in the project form ratting settings

TaskId-3251609

closes odoo/odoo#120633

Related: odoo/upgrade#4632
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
luve-odoo
2023-06-15 17:36:00 +02:00
parent 6ba77562c0
commit d387acffb7
4 changed files with 11 additions and 20 deletions
-1
View File
@@ -39,7 +39,6 @@ up a management by affair.
'views/hr_employee_views.xml',
'data/hr_timesheet_data.xml',
'views/project_task_sharing_views.xml',
'views/rating_rating_views.xml',
'views/project_update_views.xml',
'wizard/hr_employee_delete_wizard_views.xml',
'views/hr_timesheet_menus.xml',
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="rating_rating_view_search_project_inherited" model="ir.ui.view">
<field name="name">rating.rating.search.project.inherited</field>
<field name="model">rating.rating</field>
<field name="inherit_id" ref="project.rating_rating_view_search_project"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='my_ratings']" position="after">
<filter string="My Team's Ratings" name="my_team_rating" domain="[('rated_partner_id.user_ids.employee_parent_id.user_id', '=', uid)]"/>
<filter string="My Department's Ratings" name="my_department_rating" domain="[('rated_partner_id.user_ids.employee_id.member_of_department', '=', True)]"/>
</xpath>
</field>
</record>
</odoo>
+2 -2
View File
@@ -175,8 +175,8 @@ class Project(models.Model):
rating_active = fields.Boolean('Customer Ratings', default=lambda self: self.env.user.has_group('project.group_project_rating'))
allow_rating = fields.Boolean('Allow Customer Ratings', compute="_compute_allow_rating", default=lambda self: self.env.user.has_group('project.group_project_rating'))
rating_status = fields.Selection(
[('stage', 'Rating when changing stage'),
('periodic', 'Periodic rating')
[('stage', 'when reaching a given stage'),
('periodic', 'on a periodic basis')
], 'Customer Ratings Status', default="stage", required=True,
help="Collect feedback from your customers by sending them a rating request when a task enters a certain stage. To do so, define a rating email template on the corresponding stages.\n"
"Rating when changing stage: an email will be automatically sent when the task reaches the stage on which the rating email template is set.\n"
@@ -124,14 +124,20 @@
<group name="group_documents_analytics" string="Analytics" col="1" class="row mt16 o_settings_container" attrs="{'invisible': [('allow_rating', '=', False)]}">
<div>
<field name="allow_rating" invisible="1"/>
<setting name="analytic_div" help="Get customer feedback" groups="project.group_project_rating">
<setting name="analytic_div" help="Get customer feedback and evaluate the performance of your employees" groups="project.group_project_rating">
<field name="rating_active"/>
<div class="mt16" attrs="{'invisible':[('rating_active','==',False)]}">
<field name="rating_status" widget="radio" />
<span class="text-muted o_row ps-1 pb-3">Send a rating request:</span>
<field name="rating_status" widget="radio" class="o_row"/>
<div attrs="{'required': [('rating_status','=','periodic')], 'invisible': [('rating_status','!=','periodic')]}">
<label for="rating_status_period"/>
<label for="rating_status_period" string="Frequency"/>
<field name="rating_status_period"/>
</div>
<span colspan="2" class="text-muted o_row ps-1">
<i class="fa fa-lightbulb-o pe-2"/>
<span attrs="{'invisible': [('rating_status','=','periodic')]}">A rating request will be sent as soon as the task reaches a stage on which a Rating Email Template is defined.</span>
<span attrs="{'invisible': [('rating_status','=','stage')]}">Rating requests will be sent as long as the task remains in a stage on which a Rating Email Template is defined.</span>
</span>
<div class="content-group">
<div class="mt8">
<button name="%(project.open_task_type_form_domain)d" context="{'project_id':id}" icon="oi-arrow-right" type="action" string="Set a Rating Email Template on Stages" class="btn-link"/>