summaryrefslogtreecommitdiff
path: root/addons/website_sale_slides
diff options
context:
space:
mode:
authorMichaël Mattiello <mcm@odoo.com>2019-09-03 09:30:49 +0000
committerThibault Delavallée <tde@odoo.com>2019-09-03 15:02:21 +0000
commit8c9473fd78f14dea1c55765da4f3e55f8962bcc6 (patch)
treedf648c1f8016ed1df17e4005855657e111fa9fd5 /addons/website_sale_slides
parentc4eba6f5b150a0e881b7fb9b935ef1a0c3154bbf (diff)
[IMP] website_slides_{*}: improve backend UI, views and user actions
Purpose of this commit is to perform a back2basics on eLearning backend views. It helps users in their daily use of eLearning and improve UI. Containing * channel kanban view tweaking; * channel form view: some spacing and renaming improvements. Also set advanced field (new content email, share template) as group no one; * slide kanban view tweaking; * removed sections from kanban and list view for contents; * contents form view: various improvements, with notably * removed field website_url; * set publishded date is now readonly, tracked and in group_no_one as it is automatically set when publishing the lesson, and people should not update it manually; * removed the sum "Content" and replaced it by a stat button * reword quiz constraint error messages; * rating views improvements: * revamped the kanban view of rating that were a bit broken; * added a pivot view in Reporting/Reviews; * updated graph view in Reporting/Reviews; This commit also provides some usability fixes * prevent sending email if new content is category; * email: Prevent displaying an image if there is no image; LINKS Task 2049640 (website slides back2basics and fiximp) Task 2058595 (eLearning v13 testing)
Diffstat (limited to 'addons/website_sale_slides')
-rw-r--r--addons/website_sale_slides/models/slide_channel.py3
-rw-r--r--addons/website_sale_slides/views/slide_channel_views.xml3
2 files changed, 4 insertions, 2 deletions
diff --git a/addons/website_sale_slides/models/slide_channel.py b/addons/website_sale_slides/models/slide_channel.py
index 88920f58e55..685e0af9aa0 100644
--- a/addons/website_sale_slides/models/slide_channel.py
+++ b/addons/website_sale_slides/models/slide_channel.py
@@ -9,9 +9,10 @@ class Channel(models.Model):
enroll = fields.Selection(selection_add=[('payment', 'On payment')])
product_id = fields.Many2one('product.product', 'Product', index=True)
- product_sale_revenues = fields.Float(
+ product_sale_revenues = fields.Monetary(
string='Total revenues', compute='_compute_product_sale_revenues',
groups="sales_team.group_sale_salesman")
+ currency_id = fields.Many2one(related='product_id.currency_id')
_sql_constraints = [
('product_id_check', "CHECK( enroll!='payment' OR product_id IS NOT NULL )", "Product is required for on payment channels.")
diff --git a/addons/website_sale_slides/views/slide_channel_views.xml b/addons/website_sale_slides/views/slide_channel_views.xml
index 7df803c10d9..4099acf0ffa 100644
--- a/addons/website_sale_slides/views/slide_channel_views.xml
+++ b/addons/website_sale_slides/views/slide_channel_views.xml
@@ -33,7 +33,8 @@
<xpath expr="//div[@name='info_total_time']" position="after">
<div class="d-flex" attrs="{'invisible': [('enroll', '!=', 'payment')]}">
<span class="mr-auto"><label for="product_sale_revenues" class="mb0">Sales</label></span>
- <field name="product_sale_revenues"/>
+ <field name="product_sale_revenues" widget="monetary" options="{'currency_field': 'currency_id'}"/>
+ <field name="currency_id" attrs="{'invisible': True}"/>
</div>
</xpath>
<xpath expr="//a[@name='action_channel_invite']" position="attributes">