-
-
-
@@ -53,7 +50,7 @@
event.itemstree
-
+
diff --git a/addons/portal_event/__init__.py b/addons/portal_event/__init__.py
new file mode 100644
index 00000000000..70c078b769d
--- /dev/null
+++ b/addons/portal_event/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2011 OpenERP S.A ().
+#
+# 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 .
+#
+##############################################################################
+import portal_event
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/portal_event/__openerp__.py b/addons/portal_event/__openerp__.py
new file mode 100644
index 00000000000..88ca9815323
--- /dev/null
+++ b/addons/portal_event/__openerp__.py
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2011 OpenERP S.A ().
+#
+# 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 .
+#
+##############################################################################
+
+{
+ 'name' : "Portal Event",
+ 'version' : "1.0",
+ 'depends' : ["portal", "event_sale"],
+ 'author' : "OpenERP SA",
+ 'category': 'Portal',
+ 'description': """
+This module defines 'portals' to customize the access to your OpenERP database
+for external users.
+ """,
+ 'update_xml': [
+ 'security/portal_event_security.xml',
+ 'security/ir.model.access.csv',
+ ],
+ 'website': 'http://www.openerp.com',
+ 'installable': True,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/portal_event/portal_event.py b/addons/portal_event/portal_event.py
new file mode 100644
index 00000000000..41a7d81bcc5
--- /dev/null
+++ b/addons/portal_event/portal_event.py
@@ -0,0 +1,69 @@
+# -*- 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 .
+#
+##############################################################################
+
+import time
+from osv import fields, osv
+from tools.translate import _
+
+class event_event(osv.osv):
+ _inherit = 'event.event'
+
+ def make_quotation(self, cr, uid, ids, partner_id, context=None):
+ event_pool = self.pool.get('event.event')
+ register_pool = self.pool.get('event.registration')
+ sale_order_line_pool = self.pool.get('sale.order.line')
+ sale_order = self.pool.get('sale.order')
+ res_partner_obj = self.pool.get('res.partner')
+ prod_pricelist_obj = self.pool.get('product.pricelist')
+ res_users_obj = self.pool.get('res.users')
+ customer = res_partner_obj.browse(cr, uid, partner_id, context=context)
+
+ partner_id = res_users_obj.browse(cr, uid, uid, context=context).partner_id.id
+ if not partner_id:
+ raise osv.except_osv(_('Error !'),
+ _('There is no Partner defined ' \
+ 'for this event:'))
+
+ user_name = res_users_obj.browse(cr, uid, uid, context=context).name
+ price_list = prod_pricelist_obj.search(cr,uid,[],context=context)[0]
+ for event_id in self.browse(cr, uid, ids, context=context):
+ sale_order_lines = []
+ price_list = prod_pricelist_obj.search(cr,uid,[],context=context)[0]
+ new_sale_id = sale_order.create(cr, uid, {
+ 'partner_id': partner_id,
+ 'pricelist_id': price_list,
+ 'partner_invoice_id': partner_id,
+ 'partner_shipping_id': partner_id,
+ 'date_order': event_id.date_begin
+ })
+ if event_id.event_item_ids:
+ for items in event_id.event_item_ids:
+ product = items.product_id.id
+ sale_order_line = sale_order_line_pool.create(cr, uid, {
+ 'order_id': new_sale_id,
+ 'name': items.product_id.name,
+ 'product_uom_qty': items.qty,
+ 'product_id': items.product_id.id,
+ 'product_uom': items.uom_id.id,
+ 'price_unit': items.price,
+ 'date_planned': items.sales_end_date,
+ }, context=context)
+ return True
diff --git a/addons/portal_event/security/ir.model.access.csv b/addons/portal_event/security/ir.model.access.csv
new file mode 100644
index 00000000000..2ca1e3def91
--- /dev/null
+++ b/addons/portal_event/security/ir.model.access.csv
@@ -0,0 +1,4 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_event,event,event.model_event_event,portal_event.group_event_portal,1,0,0,0
+access_registration,registration,event.model_event_registration,portal_event.group_event_portal,1,0,0,0
+access_event_items,event.items,event.model_event_event,portal_event.group_event_portal,1,1,1,0
\ No newline at end of file
diff --git a/addons/portal_event/security/portal_event_security.xml b/addons/portal_event/security/portal_event_security.xml
new file mode 100644
index 00000000000..64c077c7bb9
--- /dev/null
+++ b/addons/portal_event/security/portal_event_security.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+ Portal User
+
+
+
+
+ Events Portal
+
+
+
+
+
+ Personal Events
+
+ []
+
+
+
+
+ Personal Registrations
+
+ [('partner_id.email','=',user.login)]
+
+
+
+
+
\ No newline at end of file