From 1a897732297859af73a85ede34abb834a6dc2562 Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Tue, 26 Jun 2012 16:15:01 +0530 Subject: [PATCH 1/5] [IMP]event_form bzr revid: pna@tinyerp.com-20120626104501-2a5gmtvi3ij62d0f --- addons/event/event.py | 3 ++ addons/event/event_view.xml | 65 ++++++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/addons/event/event.py b/addons/event/event.py index a348e005d06..71c8d3d8c34 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -214,6 +214,9 @@ class event_event(osv.osv): '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."), 'address_id': fields.many2one('res.partner','Location Address', readonly=False, states={'done': [('readonly', True)]}), + 'street': fields.related('address_id','street',type='char',string='Street'), + 'zip': fields.related('address_id','zip',type='char',string='zip'), + 'city': fields.related('address_id','city',type='char',string='city'), 'speaker_confirmed': fields.boolean('Speaker Confirmed', 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)]}), diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index ed539e7bf39..0504fc9cd25 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -61,40 +61,53 @@ - -
-
-

+
+
+ +
+
+
+

From to

- - - + - - - - - - + + + +
- - - - - - - + + - - + + + + + + + @@ -126,6 +139,12 @@
-

From to

+

From to

- + @@ -327,15 +334,6 @@ Event is the low level object used by meeting and others documents that should be synchronized with mobile devices or calendar applications through caldav. Most of the users should work in the Calendar menu, and not in the list of events. - - Date: Tue, 26 Jun 2012 18:31:52 +0530 Subject: [PATCH 4/5] [IMP]event_form bzr revid: pna@tinyerp.com-20120626130152-kovzkfq2tin2bx1i --- addons/event/event.py | 12 ++++++++++++ addons/event/event_view.xml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/addons/event/event.py b/addons/event/event.py index 5387a64001f..288d2fa330f 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -258,6 +258,18 @@ class event_event(osv.osv): _constraints = [ (_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']), ] + def onchange_address_id(self, cr, uid, ids, address, context=None): + data ={} + if not address: + return data + addr_obj = self.pool.get('res.partner') + addr_id = addr_obj.browse(cr, uid, address, context=context) + data = { + 'street':addr_id.street, + 'zip':addr_id.zip, + 'city':addr_id.city, + } + return {'value': data} def onchange_event_type(self, cr, uid, ids, type_event, context=None): if type_event: type_info = self.pool.get('event.type').browse(cr,uid,type_event,context) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 5caf9ad5369..d6f01677ac6 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -85,7 +85,7 @@