',
], type='http', auth="public", website=True, sitemap=False)
- def get_user_profile_avatar(self, user_id=0, width=0, height=0, crop=False, avoid_if_small=False, upper_limit=False, **post):
+ def get_user_profile_avatar(self, user_id, field='image_large', width=0, height=0, crop=False, avoid_if_small=False, upper_limit=False, **post):
+ if field not in ('image_small', 'image_medium', 'image_large'):
+ return werkzeug.exceptions.Forbidden()
+
can_sudo = self._check_avatar_access(user_id, **post)
- fname = post.get('field', 'image_medium')
if can_sudo:
status, headers, content = request.env['ir.http'].sudo().binary_content(
- model='res.users', id=user_id, field=fname,
+ model='res.users', id=user_id, field=field,
default_mimetype='image/png')
else:
status, headers, content = request.env['ir.http'].binary_content(
- model='res.users', id=user_id, field=fname,
+ model='res.users', id=user_id, field=field,
default_mimetype='image/png')
if status == 301:
return request.env['ir.http']._response_by_status(status, headers, content)
@@ -77,19 +92,9 @@ class WebsiteProfile(http.Controller):
return werkzeug.wrappers.Response(status=304)
if not content:
- img_path = modules.get_module_resource('web', 'static/src/img', 'placeholder.png')
- with open(img_path, 'rb') as f:
- image = f.read()
- content = base64.b64encode(image)
- dictheaders = dict(headers) if headers else {}
- dictheaders['Content-Type'] = 'image/png'
- headers = list(dictheaders.items())
- if not (width or height):
- suffix = fname.split('_')[-1]
- if suffix in ('small', 'medium', 'big'):
- content = getattr(tools, 'image_resize_image_%s' % suffix)(content)
+ content = self._get_default_avatar(field, headers, width, height)
- content = limited_image_resize(
+ content = tools.limited_image_resize(
content, width=width, height=height, crop=crop, upper_limit=upper_limit, avoid_if_small=avoid_if_small)
image_base64 = base64.b64decode(content)
@@ -159,6 +164,7 @@ class WebsiteProfile(http.Controller):
ranks = ranks.sorted(key=lambda b: b.karma_min)
values = {
'ranks': ranks,
+ 'user': request.env.user,
}
return request.render("website_profile.rank_main", values)
diff --git a/addons/website_profile/static/src/scss/website_profile.scss b/addons/website_profile/static/src/scss/website_profile.scss
index c636bd40d92..b45b58a587c 100644
--- a/addons/website_profile/static/src/scss/website_profile.scss
+++ b/addons/website_profile/static/src/scss/website_profile.scss
@@ -127,7 +127,6 @@ $bronze: #eea91e;
height: 128px;
}
}
- border-bottom: 1px solid lightgray;
.o_wprofile_next_rank_progress {
background-color: lightgray;
.o_wprofile_next_rank_progress_bar {
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index 06562d0e697..2a4752c2830 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -181,6 +181,7 @@
|
+
@@ -299,7 +300,7 @@
Ranks & Badges
- Do not stop learning with Odoo. Collects points on the forum or the eLearning platform. Those points will make you reach new ranks.
+ Do not stop learning with . Collects points on the forum or the eLearning platform. Those points will make you reach new ranks.
How do I earn badges? When you finish a course, reach milestones, you're awarded badges.
diff --git a/addons/website_sale_slides/data/website_sale_slides_demo.xml b/addons/website_sale_slides/data/website_sale_slides_demo.xml
index c7ff453e837..dc223fb388e 100644
--- a/addons/website_sale_slides/data/website_sale_slides_demo.xml
+++ b/addons/website_sale_slides/data/website_sale_slides_demo.xml
@@ -46,7 +46,7 @@
10
- Tools you will need to complete this course.
+ Tools you will need to complete this course.
How to find quality wood
@@ -59,7 +59,7 @@
5
- Learn of to identify quality wood in order to create solid furnitures.
+ Learn of to identify quality wood in order to create solid furnitures.
How to create your own piece of furniture
@@ -72,7 +72,7 @@
0
- From a piece of wood to a fully functional furniture, step by step.
+ From a piece of wood to a fully functional furniture, step by step.