From 556f25dd3ea484355660c386b1568671b5905ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Fri, 2 Feb 2018 17:12:21 +0100 Subject: [PATCH] [ADD] website_portal: Restrict modif personal info On the website portal, users must only be able to modify their phone and postal address. --- beesdoo_website_portal/__init__.py | 2 ++ beesdoo_website_portal/__openerp__.py | 28 ++++++++++++++++ .../controllers/__init__.py | 2 ++ beesdoo_website_portal/controllers/main.py | 27 ++++++++++++++++ .../views/portal_website_templates.xml | 32 +++++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 beesdoo_website_portal/__init__.py create mode 100644 beesdoo_website_portal/__openerp__.py create mode 100644 beesdoo_website_portal/controllers/__init__.py create mode 100644 beesdoo_website_portal/controllers/main.py create mode 100644 beesdoo_website_portal/views/portal_website_templates.xml diff --git a/beesdoo_website_portal/__init__.py b/beesdoo_website_portal/__init__.py new file mode 100644 index 0000000..2fa08e5 --- /dev/null +++ b/beesdoo_website_portal/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf8 -*- +import controllers diff --git a/beesdoo_website_portal/__openerp__.py b/beesdoo_website_portal/__openerp__.py new file mode 100644 index 0000000..248ab3a --- /dev/null +++ b/beesdoo_website_portal/__openerp__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Rémy Taymans +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'BEES coop Website Portal', + + 'description': """ + Extension of the Website Portal that prevent modification of sensible data by the users + """, + + 'author': 'Rémy Taymans', + 'license': 'AGPL-3', + 'version': '9.0.1.0', + 'website': "https://github.com/beescoop/Obeesdoo", + + 'category': 'Cooperative management', + + 'depends': [ + 'website', + 'website_portal_extend', + ], + + 'data': [ + 'views/portal_website_templates.xml', + ] +} diff --git a/beesdoo_website_portal/controllers/__init__.py b/beesdoo_website_portal/controllers/__init__.py new file mode 100644 index 0000000..757b12a --- /dev/null +++ b/beesdoo_website_portal/controllers/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import main diff --git a/beesdoo_website_portal/controllers/main.py b/beesdoo_website_portal/controllers/main.py new file mode 100644 index 0000000..104f2a8 --- /dev/null +++ b/beesdoo_website_portal/controllers/main.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- + +# Copyright 2017-2018 Rémy Taymans +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from openerp.addons.website_portal_extend.controllers.main import ExtendWebsiteAccountController + + +class BeesdooAccountWebsiteController(ExtendWebsiteAccountController): + + mandatory_billing_fields = [ + "phone", + "city", + "country_id", + "street", + "zipcode", + ] + optional_billing_fields = [ + "state_id", + ] + + def _set_mandatory_fields(self, data): + """This is not useful as the field 'company_name' is not present + anymore. + """ + pass diff --git a/beesdoo_website_portal/views/portal_website_templates.xml b/beesdoo_website_portal/views/portal_website_templates.xml new file mode 100644 index 0000000..19b0d5a --- /dev/null +++ b/beesdoo_website_portal/views/portal_website_templates.xml @@ -0,0 +1,32 @@ + + + + + + + +