diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py
index 04a4011a87f..0fa81b6d924 100644
--- a/addons/event/__openerp__.py
+++ b/addons/event/__openerp__.py
@@ -39,21 +39,19 @@ Note that:
Association / Configuration / Types of Events
""",
'author': 'OpenERP SA',
- 'depends': ['crm', 'account', 'marketing', 'email_template'],
+ 'depends': ['crm', 'account', 'marketing', 'mail'],
'init_xml': [],
'update_xml': [
'security/ir.model.access.csv',
- 'wizard/event_confirm_registration_view.xml',
'wizard/event_confirm_view.xml',
'event_view.xml',
'report/report_event_registration_view.xml',
- 'wizard/partner_event_registration_view.xml',
'board_association_view.xml',
'res_partner_view.xml',
'email_template.xml',
],
'demo_xml': ['event_demo.xml'],
- 'test': [],
+ 'test': ['test/process/event_draft2done.yml'],
'installable': True,
'active': False,
'auto_install': False,
diff --git a/addons/event/board_association_view.xml b/addons/event/board_association_view.xml
index e4d4ede3b85..0a4755ab105 100644
--- a/addons/event/board_association_view.xml
+++ b/addons/event/board_association_view.xml
@@ -45,9 +45,6 @@
-
hello ${object.contact_id.name},
- The event ${object.event_id.name} that you register is confirmed
+ The event ${object.event_id.name} that you registered from is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}. For any further information please contact our event department.
we thank you for your participation
@@ -29,7 +29,8 @@
Ticket for ${object.event_id.name}
hello ${object.contact_id.name},
- You have just been registered for the event ${object.event_id.name} to be held from ${object.event_id.date_begin} to ${object.event_id.date_end}
+
+ We confirm your registration to the event ${object.event_id.name} to be held from ${object.event_id.date_begin} to ${object.event_id.date_end}
we thank you for your participation
diff --git a/addons/event/event.py b/addons/event/event.py
index 3a908f40f04..b52b9101349 100644
--- a/addons/event/event.py
+++ b/addons/event/event.py
@@ -27,7 +27,7 @@ from tools.translate import _
import decimal_precision as dp
from crm import wizard
import time
-from datetime import datetime
+
wizard.mail_compose_message.SUPPORTED_MODELS.append('event.registration')
@@ -39,12 +39,12 @@ class event_type(osv.osv):
'name': fields.char('Event type', size=64, required=True),
'default_reply_to': fields.char('Default Reply-To', size=64,help="The email address of the organizer which is put in the 'Reply-To' of all emails sent automatically at event or registrations confirmation. You can also put your email address of your mail gateway if you use one." ),
'default_email_event': fields.many2one('email.template','Event Confirmation Email', help="It will select this default confirmation event mail value when you choose this event"),
- 'default_email_registration':fields.many2one('email.template','Registration Confirmation Email',help="It will select this default confirmation registration mail value when you choose this event"),
- 'default_registration_min':fields.integer('Default Minimum Registration',help="It will select this default minimum value when you choose this event"),
- 'default_registration_max':fields.integer('Default Maximum Registration',help="It will select this default maximum value when you choose this event"),
+ 'default_email_registration': fields.many2one('email.template','Registration Confirmation Email', help="It will select this default confirmation registration mail value when you choose this event"),
+ 'default_registration_min': fields.integer('Default Minimum Registration', help="It will select this default minimum value when you choose this event"),
+ 'default_registration_max': fields.integer('Default Maximum Registration', help="It will select this default maximum value when you choose this event"),
}
_defaults = {
- 'default_registration_min' : 0,
+ 'default_registration_min': 0,
'default_registration_max':0,
}
@@ -59,11 +59,10 @@ class event_event(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if not ids:
return []
- reads = self.browse(cr, uid, ids, context=context)
res = []
- for record in reads:
- date= time.strptime(record.date_begin,'%Y-%m-%d %H:%M:%S')
- date =time.strftime('%d/%m/%Y',date)
+ for record in self.browse(cr, uid, ids, context=context):
+ date = record.date_begin.split(" ")
+ date = date[0]
registers=''
if record.register_max !=0:
register_max = str(record.register_max)
@@ -71,7 +70,6 @@ class event_event(osv.osv):
register_tot = str(register_tot)
registers = register_tot+'/'+register_max
name = record.name+' ('+date+') '+registers
- #TODO create a best method to give the name
res.append((record['id'], name))
return res
@@ -79,7 +77,6 @@ class event_event(osv.osv):
res = self.name_get(cr, uid, ids, context=context)
return dict(res)
-
def copy(self, cr, uid, id, default=None, context=None):
""" Reset the state and the registrations while copying an event
"""
@@ -118,7 +115,7 @@ class event_event(osv.osv):
('state', 'not in', ['draft', 'cancel'])], context=context)
register_pool.mail_user_confirm(cr, uid, reg_ids)
return self.write(cr, uid, ids, {'state': 'confirm'}, context=context)
-
+
def _get_register(self, cr, uid, ids, fields, args, context=None):
"""Get Confirm or uncofirm register value.
@param ids: List of Event registration type's id
@@ -138,13 +135,12 @@ class event_event(osv.osv):
state += ['open']
if 'register_prospect' in fields:
state.append('draft')
- #TODO refactor this part of code to have only one search
- reg_ids = register_pool.search(cr, uid, [('event_id', '=', event.id),('state', '=', 'open')], context=context)
- reg_ids1= register_pool.search(cr, uid, [('event_id', '=', event.id),('state', '=', 'done')], context=context)
- reg_ids2= register_pool.search(cr, uid, [('event_id', '=', event.id),('state', '=', 'draft')], context=context)
- res[event.id]['register_current'] = len(reg_ids)
- res[event.id]['register_prospect'] = len(reg_ids2)
- res[event.id]['register_participated'] = len(reg_ids1)
+ reg_open_ids = register_pool.search(cr, uid, [('event_id', '=', event.id),('state', '=', 'open')], context=context)
+ reg_done_ids= register_pool.search(cr, uid, [('event_id', '=', event.id),('state', '=', 'done')], context=context)
+ reg_draft_ids= register_pool.search(cr, uid, [('event_id', '=', event.id),('state', '=', 'draft')], context=context)
+ res[event.id]['register_current'] = len(reg_open_ids)
+ res[event.id]['register_prospect'] = len(reg_done_ids)
+ res[event.id]['register_attended'] = len(reg_draft_ids)
return res
@@ -157,7 +153,7 @@ class event_event(osv.osv):
'register_min': fields.integer('Minimum Registrations', help="You can for each event define a minimum registration level. If you do not enough registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
'register_current': fields.function(_get_register, string='Confirmed Registrations', multi='register_current'),
'register_prospect': fields.function(_get_register, string='Unconfirmed Registrations', multi='register_prospect'),
- 'register_participated': fields.function(_get_register, string='Participated Registrations', multi='register_prospect'),
+ 'register_attended': fields.function(_get_register, string='Attended Registrations', multi='register_prospect'),
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
'date_begin': fields.datetime('Starting Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'date_end': fields.datetime('Closing Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
@@ -171,16 +167,15 @@ class event_event(osv.osv):
'email_registration_id' : fields.many2one('email.template','Registration Confirmation Email'),
'email_confirmation_id' : fields.many2one('email.template','Event Confirmation Email', help="If you set an email template, each participant will receive this email announcing the confirmation of the event."),
'full_name' : fields.function(_name_get_fnc, type="char", string='Name'),
- 'reply_to': fields.char('Reply-To Email', size=64, readonly=False, states={'done': [('readonly', True)]}, help="The email address of the organizer which is put in the 'Reply-To' of all emails sent automatically at event or registrations confirmation. You can also put your email address of your mail gateway if you use one."),
+ 'reply_to': fields.char('Reply-To Email', size=64, readonly=False, states={'done': [('readonly', True)]}, help="The email address of the organizer is likely to be put here, with the effect to be in the 'Reply-To' of the mails sent automatically at event or registrations confirmation. You can also put the email address of your mail gateway if you use one."),
'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who will be giving speech at the event."),
'speaker_ids': fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}),
'address_id': fields.many2one('res.partner.address','Location Address', readonly=False, states={'done': [('readonly', True)]}),
- 'speaker_confirmed': fields.boolean('Speaker Confirmed',help='You can choose this checkbox for your information', readonly=False, states={'done': [('readonly', True)]}),
+ 'speaker_confirmed': fields.boolean('Speaker Confirmed',help='You can choose this checkbox for your information => ca veut rien dire ca', readonly=False, states={'done': [('readonly', True)]}),
'country_id': fields.related('address_id', 'country_id',
type='many2one', relation='res.country', string='Country', readonly=False, states={'done': [('readonly', True)]}),
'note': fields.text('Description', readonly=False, states={'done': [('readonly', True)]}),
'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}),
- 'product_id': fields.many2one('product.product', 'Product', readonly=True, states={'draft': [('readonly', False)]}, help="The product is optional and only serves informative purposes. It will be used for analysis mainly."),
}
_defaults = {
@@ -224,21 +219,21 @@ class event_registration(osv.osv):
'nb_register': fields.integer('Number of Participants', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'event_id': fields.many2one('event.event', 'Event', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}),
- 'partner_id_address': fields.many2one('res.partner.address', 'Partner', states={'done': [('readonly', True)]}),
- "contact_id": fields.many2one('res.partner.address', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}), #TODO: filter only the contacts that have a function into the selected partner_id
+ 'partner_address_id': fields.many2one('res.partner.address', 'Partner', states={'done': [('readonly', True)]}),
+ "contact_id": fields.many2one('res.partner.address', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}),
'create_date': fields.datetime('Creation Date' , readonly=True),
- 'date_closed': fields.datetime('Participated Date', readonly=True),
+ 'date_closed': fields.datetime('Attended Date', readonly=True),
'date_open': fields.datetime('Registration Date', readonly=True),
- 'email_from': fields.related('event_id','reply_to',string='Reply-to Email', type='char', size=128, readonly=True,),
+ 'reply_to': fields.related('event_id','reply_to',string='Reply-to Email', type='char', size=128, readonly=True,),
'log_ids': fields.one2many('mail.message', 'res_id', 'Logs', domain=[('email_from', '=', False),('model','=',_name)]),
- 'date_deadline': fields.related('event_id','date_end', type='datetime', string="Event End Date", readonly=True),
- 'date': fields.related('event_id', 'date_begin', type='datetime', string="Event Start Date", readonly=True),
+ 'event_end_date': fields.related('event_id','date_end', type='datetime', string="Event End Date", readonly=True),
+ 'event_begin_date': fields.related('event_id', 'date_begin', type='datetime', string="Event Start Date", readonly=True),
'user_id': fields.many2one('res.users', 'Responsible', states={'done': [('readonly', True)]}),
'company_id': fields.related('event_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True, states={'draft':[('readonly',False)]}),
'state': fields.selection([('draft', 'Unconfirmed'),
('open', 'Confirmed'),
('cancel', 'Cancelled'),
- ('done', 'Participated')], 'State', \
+ ('done', 'Attended')], 'State',
size=16, readonly=True)
}
@@ -252,6 +247,7 @@ class event_registration(osv.osv):
def do_draft(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'state': 'draft'}, context=context)
+
def registration_open(self, cr, uid, ids, context=None):
""" Open Registration
"""
@@ -275,11 +271,6 @@ class event_registration(osv.osv):
def case_open(self, cr, uid, ids, context):
return self.registration_open(cr, uid, ids, context)
- # event uses add_note wizard from crm, which expects case_* methods
- #def case_close(self, cr, uid, ids, context=None):
- # self.do_close(cr, uid, ids, context)
- # return self.write(cr, uid, ids, {'state': 'done'})
-
# event uses add_note wizard from crm, which expects case_* methods
def case_cancel(self, cr, uid, ids, context=None):
""" Cancel Registration
@@ -328,7 +319,7 @@ class event_registration(osv.osv):
if not contact:
return data
addr_obj = self.pool.get('res.partner.address')
- contact_id = addr_obj.browse(cr, uid, contact, context)
+ contact_id = addr_obj.browse(cr, uid, contact, context=context)
data = {
'email':contact_id.email,
'contact_id':contact_id.id,
@@ -347,8 +338,8 @@ class event_registration(osv.osv):
event_obj = self.pool.get('event.event')
data_event = event_obj.browse(cr, uid, event_id, context=context)
return {'value':
- {'date': data_event.date_begin,
- 'date_deadline': data_event.date_end,
+ {'event_begin_date': data_event.date_begin,
+ 'event_end_date': data_event.date_end,
'company_id': data_event.company_id and data_event.company_id.id or False,
}
}
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 08979b7262c..f5d405d9369 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -122,7 +122,7 @@
-
+
@@ -279,7 +279,7 @@
-
+
@@ -311,15 +311,15 @@
-
-
+
+
-
+
@@ -328,9 +328,9 @@
-
+
diff --git a/addons/event/res_partner.py b/addons/event/res_partner.py
index a1cb41b2cd0..3952f2f82b6 100644
--- a/addons/event/res_partner.py
+++ b/addons/event/res_partner.py
@@ -29,9 +29,6 @@ class res_partner(osv.osv):
'event_ids': fields.one2many('event.event','main_speaker_id', readonly=True),
'event_registration_ids': fields.one2many('event.registration','partner_id', readonly=True),
}
- _defaults = {
- 'speaker':True
- }
res_partner()
diff --git a/addons/event/res_partner_view.xml b/addons/event/res_partner_view.xml
index 75113f1dbed..410030408c7 100644
--- a/addons/event/res_partner_view.xml
+++ b/addons/event/res_partner_view.xml
@@ -30,7 +30,7 @@
-
+
diff --git a/addons/event/test/process/event_confirm2done.yml b/addons/event/test/process/event_confirm2done.yml
deleted file mode 100644
index 4d5542896f7..00000000000
--- a/addons/event/test/process/event_confirm2done.yml
+++ /dev/null
@@ -1,22 +0,0 @@
--
- I want to organize one conference event on "OpenERP Business", Customer subscribe/join
- into "Conference on OpenERP Business" with 6 tickets, first I confim this event.
--
- !python {model: event.event}: |
- self.button_confirm(cr, uid, [ref("event_0")])
--
- I Check that Event is "confirmed", and Its automatically sending mail to registered
- partner which joined to this event.
--
- !assert {model: event.event, id: event_0}:
- - state == 'confirm', "Event should be confirmed."
--
- After completed event, I close this event.
--
- !python {model: event.event}: |
- self.button_done(cr, uid, [ref("event_0")])
--
- Check that conference is in "close" state.
--
- !assert {model: event.event, id: event_0}:
- - state == 'done', "Event should be Closed."
diff --git a/addons/event/test/process/event_draft2cancel.yml b/addons/event/test/process/event_draft2cancel.yml
deleted file mode 100644
index 48cb102f3e8..00000000000
--- a/addons/event/test/process/event_draft2cancel.yml
+++ /dev/null
@@ -1,22 +0,0 @@
--
- I want to organize event and its need Minimum 50 Registrations to confirm/start
- this Event, but Only 10 registration confirm for this event, I confirm this event.
--
- !python {model: event.event}: |
- self.button_confirm(cr, uid, [ref("event_1")])
--
- Now I cheked for event and It should not be confirm because registrations for
- this event is below limit.
--
- !assert {model: event.event, id: event_1}:
- - state == 'confirm', "Event should be confirm."
--
- So I cancel this Event
--
- !python {model: event.event}: |
- self.button_cancel(cr, uid, [ref("event_1")])
--
- I check event should be cancel.
--
- !assert {model: event.event, id: event_1}:
- - state == 'cancel', "Event should be cancel"
diff --git a/addons/event/test/process/partner_register2invoice.yml b/addons/event/test/process/partner_register2invoice.yml
deleted file mode 100644
index 022276f0a7c..00000000000
--- a/addons/event/test/process/partner_register2invoice.yml
+++ /dev/null
@@ -1,32 +0,0 @@
--
- I want to organize one conference event, First I registered partner for event
- with 5 tickets.
--
- !python {model: partner.event.registration}: |
- context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_ericdubois0")], 'active_id': ref("base.res_partner_ericdubois0")})
- register = self.create(cr, uid, {'event_id': ref('event_1'),'nb_register': 5}, context=context)
- self.open_registration(cr, uid, [register], context=context)
--
- Now I check for registration created base on partner.
--
- !python {model: event.registration}: |
- ids = self.search(cr, uid, [('partner_id','=',ref("base.res_partner_ericdubois0")), ('event_id', '=', ref('event_1'))])
- assert ids, "Registration should be create here."
--
- I confirm registration process.
--
- !python {model: event.registration}: |
- self.check_confirm(cr, uid, [ref("reg_1_1")])
--
- I Check that Registration is confirm.
--
- !assert {model: event.registration, id: reg_1_1}:
- - state == 'open', "Registration should be open here."
-
--
- I Check that Registration is close.
--
- !assert {model: event.registration, id: reg_1_1}:
- - state == 'done', "Registration should be done here."
-
-
diff --git a/addons/event/wizard/__init__.py b/addons/event/wizard/__init__.py
index d38e350bd11..92e33960484 100644
--- a/addons/event/wizard/__init__.py
+++ b/addons/event/wizard/__init__.py
@@ -20,7 +20,5 @@
##############################################################################
-import event_confirm_registration
import event_confirm
-import partner_event_registration
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event/wizard/event_confirm_registration.py b/addons/event/wizard/event_confirm_registration.py
deleted file mode 100644
index fe1664affa2..00000000000
--- a/addons/event/wizard/event_confirm_registration.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- 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 fields, osv
-from tools.translate import _
-
-class event_confirm_registration(osv.osv_memory):
- """
- Confirm Event Registration
- """
- _name = "event.confirm.registration"
- _description = "Confirmation for Event Registration"
-
- _columns = {
- 'msg': fields.text('Message', readonly=True),
- }
- _defaults = {
- 'msg': 'The event limit is reached. What do you want to do?'
- }
-
-
-
- def confirm(self, cr, uid, ids, context=None):
- return {'type': 'ir.actions.act_window_close'}
-
-event_confirm_registration()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event/wizard/event_confirm_registration_view.xml b/addons/event/wizard/event_confirm_registration_view.xml
deleted file mode 100644
index 72ecbe2cad8..00000000000
--- a/addons/event/wizard/event_confirm_registration_view.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- Registration Confirmation
- event.confirm.registration
- form
-
-
-
-
-
-
- Registrations
- ir.actions.act_window
- event.confirm.registration
- form
- form
-
- new
-
-
-
-
diff --git a/addons/event/wizard/partner_event_registration.py b/addons/event/wizard/partner_event_registration.py
deleted file mode 100644
index deff890a52f..00000000000
--- a/addons/event/wizard/partner_event_registration.py
+++ /dev/null
@@ -1,140 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 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 fields, osv
-from tools.translate import _
-from decimal_precision import decimal_precision as dp
-
-class partner_event_registration(osv.osv_memory):
- """ event Registration """
-
- _name = "partner.event.registration"
- _description = __doc__
- _order = 'event_id'
-
- _columns = {
- 'event_id': fields.many2one('event.event', 'Event'),
- 'event_type': fields.many2one('event.type', 'Type', readonly=True),
- 'unit_price': fields.float('Registration Cost', digits_compute=dp.get_precision('Sale Price')),
- 'start_date': fields.datetime('Start date', help="Beginning Date of Event", readonly=True),
- 'end_date': fields.datetime('Closing date', help="Closing Date of Event", readonly=True),
- 'nb_register': fields.integer('Number of Registration'),
- }
- _defaults = {
- 'nb_register': 1,
- }
-
- def open_registration(self, cr, uid, ids, context=None):
- """This Function Open Registration For Given Event id and Partner.
-
- """
- value = {}
- res_obj = self.pool.get('res.partner')
- addr_obj = self.pool.get('res.partner.address')
- reg_obj = self.pool.get('event.registration')
- mod_obj = self.pool.get('ir.model.data')
-
- record_ids = context and context.get('active_ids', []) or []
- addr = res_obj.address_get(cr, uid, record_ids)
- email = False
- contact_id = addr.get('default', False)
- if contact_id:
- email = addr_obj.browse(cr, uid, contact_id, context=context).email
-
- result = mod_obj.get_object_reference(cr, uid, 'event', 'view_registration_search')
- res = result and result[1] or False
-
- # Select the view
-
- id2 = mod_obj.get_object_reference(cr, uid, 'event', 'view_event_registration_form')
- id2 = id2 and id2[1] or False
- id3 = mod_obj.get_object_reference(cr, uid, 'event', 'view_event_registration_tree')
- id3 = id3 and id3[1] or False
-
- for current in self.browse(cr, uid, ids, context=context):
- for partner in res_obj.browse(cr, uid, record_ids, context=context):
- new_case = reg_obj.create(cr, uid, {
- 'name': 'Registration',
- 'event_id': current.event_id and current.event_id.id or False,
- 'unit_price': current.unit_price,
- 'partner_id': partner.id,
- 'event_product': current.event_id.product_id.name,
- 'contact_id': contact_id,
- 'email_from': email,
- 'nb_register': current.nb_register,
-
- }, context=context)
-
- value = {
- 'name': _('Event Registration'),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'event.registration',
- 'res_id': new_case,
- 'views': [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
- 'type': 'ir.actions.act_window',
- 'search_view_id': res
- }
- return value
-
- def name_get(self, cr, uid, ids, context=None):
- """Overrides orm name_get method
- @param ids: List of partner_event_register ids
- """
-
- res = []
- if not ids:
- return res
- reads = self.read(cr, uid, ids, ['event_type', 'event_id'], context=context)
- for record in reads:
- event_id = record['event_id'][1]
- if record['event_type']:
- event_id = record['event_type'][1] + ' on ' + event_id
- res.append((record['id'], event_id))
- return res
-
- def onchange_event_id(self, cr, uid, ids, event_id, context=None):
- res = {}
- event_obj = self.pool.get('event.event')
- product_obj = self.pool.get('product.product')
- partner_obj = self.pool.get('res.partner')
- if context is None:
- context = {}
- partner_id = context.get('active_id', False)
- if event_id:
- event = event_obj.browse(cr, uid, event_id, context=context)
- pricelist_id = event.pricelist_id and event.pricelist_id.id or False
- if partner_id:
- partner = partner_obj.browse(cr, uid, partner_id, context=context)
- pricelist_id = pricelist_id or partner.property_product_pricelist.id
- unit_price = product_obj._product_price(cr, uid, [event.product_id.id], False, False, {'pricelist': pricelist_id})[event.product_id.id]
-
- res['value'] = {
- 'event_type': event.type and event.type.id or False,
- 'start_date': event.date_begin,
- 'end_date': event.date_end,
- 'unit_price': unit_price,
- }
- return res
-
-partner_event_registration()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event/wizard/partner_event_registration_view.xml b/addons/event/wizard/partner_event_registration_view.xml
deleted file mode 100644
index c0b10a89ea9..00000000000
--- a/addons/event/wizard/partner_event_registration_view.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
- Partner event registration
- partner.event.registration
- form
-
-
-
-
-
-
-
-