From 3bbc7e0efc3b1b001e805ab9cfa2e0ae100e2952 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 27 Jul 2012 16:53:37 +0200 Subject: [PATCH] [ADD] the possibility to show or hide events in the portal bzr revid: abo@openerp.com-20120727145337-69ey9rcb070kaatj --- addons/portal/__init__.py | 1 + addons/portal/__openerp__.py | 1 + addons/portal/event.py | 39 ++++++++++++++++++++++++++++++++++++ addons/portal/event_view.xml | 23 +++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 addons/portal/event.py create mode 100644 addons/portal/event_view.xml diff --git a/addons/portal/__init__.py b/addons/portal/__init__.py index 65b924183e1..8d7e0fdef46 100644 --- a/addons/portal/__init__.py +++ b/addons/portal/__init__.py @@ -22,6 +22,7 @@ import portal import wizard import res_user +import event # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/portal/__openerp__.py b/addons/portal/__openerp__.py index 6dd22a46ca2..58896c4bed9 100644 --- a/addons/portal/__openerp__.py +++ b/addons/portal/__openerp__.py @@ -39,6 +39,7 @@ very handy when used in combination with the module 'share'. """, 'website': 'http://www.openerp.com', 'data': [ + 'event_view.xml', 'security/portal_security.xml', 'security/ir.model.access.csv', 'portal_view.xml', diff --git a/addons/portal/event.py b/addons/portal/event.py new file mode 100644 index 00000000000..4d7286b7395 --- /dev/null +++ b/addons/portal/event.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields + +class event_event(osv.osv): + _description = "Portal event" + _inherit = 'event.event' + + """ + ``visibility``: defines if the employee appears on the portal's contact page + - 'public' means the event will appear for everyone (anonymous) + - 'private' means the event won't appear + """ + _columns = { + 'visibility': fields.selection([('public', 'Public'),('private', 'Private')], + string='Visibility', help='Event\'s visibility in the portal\'s contact page'), + } + _defaults = { + 'visibility': 'private', + } diff --git a/addons/portal/event_view.xml b/addons/portal/event_view.xml new file mode 100644 index 00000000000..6966add58e8 --- /dev/null +++ b/addons/portal/event_view.xml @@ -0,0 +1,23 @@ + + + + + + + portal.event.form + event.event + form + + + + + + + + + + + + + +