From 290247fc1e51fc2beddba13648d452ea09b544f1 Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Wed, 19 Feb 2025 14:06:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=BD=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __init__.py | 2 ++ __manifest__.py | 13 +++++++++++++ controllers.py | 10 ++++++++++ i18n/auth_password_policy_portal.pot | 15 +++++++++++++++ static/src/scss/portal_policy.scss | 6 ++++++ views/templates.xml | 12 ++++++++++++ 6 files changed, 58 insertions(+) create mode 100644 __init__.py create mode 100644 __manifest__.py create mode 100644 controllers.py create mode 100644 i18n/auth_password_policy_portal.pot create mode 100644 static/src/scss/portal_policy.scss create mode 100644 views/templates.xml diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..153a9e3 --- /dev/null +++ b/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import controllers diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..b5fefb2 --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,13 @@ +{ + 'name': "Password Policy support for Signup", + 'depends': ['auth_password_policy', 'portal'], + 'category': 'Tools', + 'auto_install': True, + 'data': ['views/templates.xml'], + 'assets': { + 'web.assets_frontend': [ + 'auth_password_policy_portal/static/**/*', + ], + }, + 'license': 'LGPL-3', +} diff --git a/controllers.py b/controllers.py new file mode 100644 index 0000000..8967852 --- /dev/null +++ b/controllers.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- + +from odoo.http import request +from odoo.addons.portal.controllers.portal import CustomerPortal + +class CustomerPortalPasswordPolicy(CustomerPortal): + def _prepare_portal_layout_values(self): + d = super()._prepare_portal_layout_values() + d['password_minimum_length'] = request.env['ir.config_parameter'].sudo().get_param('auth_password_policy.minlength') + return d diff --git a/i18n/auth_password_policy_portal.pot b/i18n/auth_password_policy_portal.pot new file mode 100644 index 0000000..06d842d --- /dev/null +++ b/i18n/auth_password_policy_portal.pot @@ -0,0 +1,15 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-26 21:55+0000\n" +"PO-Revision-Date: 2023-10-26 21:55+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/static/src/scss/portal_policy.scss b/static/src/scss/portal_policy.scss new file mode 100644 index 0000000..8a3cb18 --- /dev/null +++ b/static/src/scss/portal_policy.scss @@ -0,0 +1,6 @@ +.o_portal_security_body #new-password-group { + position: relative; + meter { + bottom: calc(#{$input-height-sm} / 2 - 7px); + } +} diff --git a/views/templates.xml b/views/templates.xml new file mode 100644 index 0000000..46b44f6 --- /dev/null +++ b/views/templates.xml @@ -0,0 +1,12 @@ + + +