diff --git a/beesdoo_website_eater/__init__.py b/beesdoo_website_eater/__init__.py new file mode 100644 index 0000000..2fa08e5 --- /dev/null +++ b/beesdoo_website_eater/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf8 -*- +import controllers diff --git a/beesdoo_website_eater/__openerp__.py b/beesdoo_website_eater/__openerp__.py new file mode 100644 index 0000000..6607d28 --- /dev/null +++ b/beesdoo_website_eater/__openerp__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Rémy Taymans +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'BEES coop Website Eater', + + 'summary': """ + Show the eaters of a cooperator in the website portal. + """, + 'description': """ + """, + + 'author': 'Rémy Taymans', + 'license': 'AGPL-3', + 'version': '9.0.1.0', + 'website': "https://github.com/beescoop/Obeesdoo", + + 'category': 'Website', + + 'depends': [ + 'website', + 'website_portal_v10', + 'beesdoo_base', + ], + + 'data': [ + 'views/beesdoo_website_eater_templates.xml', + ] +} diff --git a/beesdoo_website_eater/controllers/__init__.py b/beesdoo_website_eater/controllers/__init__.py new file mode 100644 index 0000000..757b12a --- /dev/null +++ b/beesdoo_website_eater/controllers/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import main diff --git a/beesdoo_website_eater/controllers/main.py b/beesdoo_website_eater/controllers/main.py new file mode 100644 index 0000000..d0ce8d2 --- /dev/null +++ b/beesdoo_website_eater/controllers/main.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Rémy Taymans +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from openerp.http import request + +from openerp.addons.website_portal_v10.controllers.main import WebsiteAccount + + +class EaterWebsiteAccount(WebsiteAccount): + + def _prepare_portal_layout_values(self): + values = super(EaterWebsiteAccount, + self)._prepare_portal_layout_values() + partner = request.env.user.partner_id.commercial_partner_id + values.update({ + 'eaters': partner.child_eater_ids, + }) + return values diff --git a/beesdoo_website_eater/views/beesdoo_website_eater_templates.xml b/beesdoo_website_eater/views/beesdoo_website_eater_templates.xml new file mode 100644 index 0000000..7f64dab --- /dev/null +++ b/beesdoo_website_eater/views/beesdoo_website_eater_templates.xml @@ -0,0 +1,31 @@ + + + + + + + +