summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2017-06-07 18:13:11 +0200
committerThibault Delavallée <tde@odoo.com>2017-08-08 14:58:49 +0200
commitea27c1b7a341b6f913197a2e8843562c5e71ea52 (patch)
treeedff4bb4b14ba7afea08ce0c92ba609aa5d314fa /addons/web
parent86aa1b81bcc7452e42c84a995479a59440dab956 (diff)
[MOV] website_portal, portal: move customer portal to portal module
This commit moves the whole customer portal to the portal module. It now completely uses portal and http_routing features and is not dependent on website anymore. An override of web controller is added in portal in order to redirect portal users to /my instead of /web. That way once having the customer portal installed all share users are correctly redirected to their account. All modules defining customer portal templates and controllers are updated accordingly.
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/controllers/main.py7
-rw-r--r--addons/web/static/src/less/portal.less38
-rw-r--r--addons/web/views/webclient_templates.xml2
3 files changed, 44 insertions, 3 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index fd2d596a4b2..e2f2d7814a4 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -458,6 +458,9 @@ class Home(http.Controller):
ensure_db()
return werkzeug.utils.redirect(redirect, 303)
+ def _login_redirect(self, uid, redirect=None):
+ return redirect if redirect else '/web'
+
@http.route('/web/login', type='http', auth="none")
def web_login(self, redirect=None, **kw):
ensure_db()
@@ -479,9 +482,7 @@ class Home(http.Controller):
uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password'])
if uid is not False:
request.params['login_success'] = True
- if not redirect:
- redirect = '/web'
- return http.redirect_with_hash(redirect)
+ return http.redirect_with_hash(self._login_redirect(uid, redirect=redirect))
request.uid = old_uid
values['error'] = _("Wrong login/password")
else:
diff --git a/addons/web/static/src/less/portal.less b/addons/web/static/src/less/portal.less
new file mode 100644
index 00000000000..afc5b17dd08
--- /dev/null
+++ b/addons/web/static/src/less/portal.less
@@ -0,0 +1,38 @@
+.o_portal {
+ .breadcrumb {
+ margin-bottom: 0px;
+ }
+}
+.o_my_status_table {
+ text-align: right;
+ tr > :first-child {
+ text-align: left;
+ }
+ tr th {
+ text-align: center;
+ }
+}
+
+.o_my_home_content > .page-header > a:hover {
+ text-decoration: none;
+}
+
+.portal-wrap table.table tr {
+ word-wrap: break-word;
+}
+
+.search_panel_fixed_width {
+ overflow: hidden;
+ max-width: 125px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.oe_attachments .o_image_small {
+ height: 40px;
+ width: 50px;
+}
+
+.breadcrumb {
+ display: inline-block;
+}
diff --git a/addons/web/views/webclient_templates.xml b/addons/web/views/webclient_templates.xml
index 730b4d883e1..c2c3d5a2a4c 100644
--- a/addons/web/views/webclient_templates.xml
+++ b/addons/web/views/webclient_templates.xml
@@ -241,6 +241,8 @@
<t t-call="web.less_helpers"/>
<link rel="stylesheet" type="text/less" href="/web/static/src/less/import_bootstrap.less"/>
+ <link rel='stylesheet' type="text/less" href='/web/static/src/less/portal.less'/>
+
<script type="text/javascript" src="/web/static/src/js/services/session.js"></script>
</template>