summaryrefslogtreecommitdiff
path: root/addons/website_profile/views/website_profile.xml
diff options
context:
space:
mode:
authorPatrick Hoste <pko@odoo.com>2020-03-24 13:13:03 +0000
committerThibault Delavallée <tde@odoo.com>2020-03-30 09:24:14 +0000
commite711dc08d462fdc635b1f803b792e52c2fb9b545 (patch)
tree06e9b5eecb9d4bd846351646d387fb78151b1d05 /addons/website_profile/views/website_profile.xml
parenta8b803c26b7c81b1b04ed2e4286c272aba7f5568 (diff)
[FIX] website_profile: fix edit profile issue
PURPOSE Before this commit when an administrator edit another user's profile it was his own data that displayed for the changes. This commit fixes this issue. SPECIFICATION Add a test in both controller route when displaying the edit view and when submitting the changes that check if the edited user is the same as the actual user. LINKS Task ID : 2222043 PR : #48262 closes odoo/odoo#48575 X-original-commit: 4ab4de5b57a17002d8b14584c7d39a29e8bca357 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_profile/views/website_profile.xml')
-rw-r--r--addons/website_profile/views/website_profile.xml6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index adfd3c2ff3d..1849d3f6257 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -204,7 +204,9 @@
<div class="col-12 col-md-4 col-lg-3">
<div t-attf-class="d-flex align-items-start h-100 #{'justify-content-between' if (request.env.user == user) else 'justify-content-around' }">
<div class="o_wprofile_pict d-inline-block mb-3 mb-md-0" t-attf-style="background-image: url(#{website.image_url(user, 'image_1024')});"/>
- <a class="btn btn-primary d-inline-block d-md-none" t-if="request.env.user == user and user.karma != 0" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}">
+ <a class="btn btn-primary d-inline-block d-md-none"
+ t-if="request.env.user == user and user.karma != 0"
+ t-attf-href="/profile/edit?url_param=#{edit_button_url_param}&amp;user_id=#{user.id}">
<i class="fa fa-pencil mr-1"/>EDIT
</a>
</div>
@@ -216,7 +218,7 @@
<h1 class="o_card_people_name">
<span t-field="user.name"/><small t-if="user.karma == 0"> (not verified)</small>
</h1>
- <a class="btn btn-primary d-none d-md-inline-block" t-if="request.env.user == user and user.karma != 0 or request.env.user._is_admin()" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}">
+ <a class="btn btn-primary d-none d-md-inline-block" t-if="request.env.user == user and user.karma != 0 or request.env.user._is_admin()" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}&amp;user_id=#{user.id}">
<i class="fa fa-pencil mr-2"/>EDIT PROFILE
</a>
</div>