From 36c13a66b08c1fdcf4a48c006bdc2e26bf8f95b0 Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Thu, 29 Nov 2012 15:50:30 +0530 Subject: [PATCH 01/10] [Imp] Improved code for Event module bzr revid: ggh@tinyerp.com-20121129102030-iyn0ct8dmfa00al8 --- addons/event/event_view.xml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 9a548679dd3..3ee83a8553e 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -6,7 +6,7 @@ event.registration form Registrations - calendar,tree,form,graph + tree,form,calendar,graph {'search_default_event_id': active_id, 'default_event_id': active_id} @@ -137,19 +137,13 @@ - - + + - - - - - - + + - - - + From a288e4a50d40debc72ee231376ba4105042f6106 Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Fri, 30 Nov 2012 12:25:02 +0530 Subject: [PATCH 02/10] [IMP]Improve the code event field proper placed in SO bzr revid: ggh@tinyerp.com-20121130065502-k4t7ik7rsac7xrno --- addons/event_sale/event_sale_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml index ab7568d704e..4d2f9678157 100644 --- a/addons/event_sale/event_sale_view.xml +++ b/addons/event_sale/event_sale_view.xml @@ -21,8 +21,8 @@ sale.order - - + + From fe498548275430e33cf46b1ffd29dcb88b4302cd Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Fri, 30 Nov 2012 16:45:27 +0530 Subject: [PATCH 03/10] [imp] Improve the code for event in domain bzr revid: ggh@tinyerp.com-20121130111527-480ch75wdetlp7t2 --- addons/event_sale/event_sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml index 4d2f9678157..68c77b08d23 100644 --- a/addons/event_sale/event_sale_view.xml +++ b/addons/event_sale/event_sale_view.xml @@ -22,7 +22,7 @@ - + From 5ed6cae896099ea1ee8b35bca74db37a615e9a27 Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Mon, 3 Dec 2012 15:04:41 +0530 Subject: [PATCH 04/10] [IMP]Event registration create from SO we remove one messages bzr revid: ggh@tinyerp.com-20121203093441-ldiliu306x7l7ii0 --- addons/event_sale/event_sale.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index f4d7fcaa013..bc87de7c0c3 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -71,6 +71,8 @@ class sale_order_line(osv.osv): ''' create registration with sale order ''' + if context is None: + context = {} registration_obj = self.pool.get('event.registration') sale_obj = self.pool.get('sale.order') for order_line in self.browse(cr, uid, ids, context=context): @@ -84,7 +86,24 @@ class sale_order_line(osv.osv): 'origin': order_line.order_id.name, 'event_id': order_line.event_id.id, } + message = _("The registration has been created for event %s from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name) + context.update({'sale_event': True, 'message': message }) registration_id = registration_obj.create(cr, uid, dic, context=context) - message = _("The registration %s has been created from the Sale Order %s.") % (registration_id, order_line.order_id.name) - registration_obj.message_post(cr, uid, [registration_id], body=message, context=context) return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context) + +sale_order_line() + +class event_registration(osv.osv): + _inherit = 'event.registration' + + # ---------------------------------------- + # OpenChatter methods and notifications + # ---------------------------------------- + + def create_send_note(self, cr, uid, ids, context=None): + if context.get("sale_event") and context.get("message"): + message = context.get("message") + self.message_post(cr, uid, ids, body=message, context=context) + else: + super(event_registration, self).create_send_note(cr, uid, ids, context) + return True From 38d8b60cc5dfdd46cc1f3540f8451d14e871a1b0 Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Fri, 14 Dec 2012 12:16:05 +0530 Subject: [PATCH 05/10] [IMP]Add Placeholder in Event Details bzr revid: ggh@tinyerp.com-20121214064605-lgctzjh07hmqkwua --- addons/event/event_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 65526aba7e9..ec6104f2e48 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -106,7 +106,7 @@ - + From c24ba91ef90644d593bef9154411c3c658dbc2c8 Mon Sep 17 00:00:00 2001 From: "Farid Ghanchi (OpenERP)" Date: Wed, 15 May 2013 16:46:44 +0530 Subject: [PATCH 06/10] [IMP] Improved code bzr revid: ggh@tinyerp.com-20130515111644-z95wn1t0tful5o8z --- addons/event_sale/event_sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index 68a34135eaf..15e528dbaff 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -88,6 +88,7 @@ class sale_order_line(osv.osv): message = _("The registration has been created for event %s from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name) context.update({'sale_event': True, 'message': message }) registration_id = registration_obj.create(cr, uid, dic, context=context) + registration_obj.create_send_note(cr, uid, registration_id, context=context) return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context) sale_order_line() @@ -104,5 +105,5 @@ class event_registration(osv.osv): message = context.get("message") self.message_post(cr, uid, ids, body=message, context=context) else: - super(event_registration, self).create_send_note(cr, uid, ids, context) + super(event_registration, self).create_send_note(cr, uid, ids, context=context) return True From 7d276f01536db38975017ec66f1075522c8456e3 Mon Sep 17 00:00:00 2001 From: "Farid Ghanchi (OpenERP)" Date: Thu, 16 May 2013 19:13:04 +0530 Subject: [PATCH 07/10] [IMP] Improve the code bzr revid: ggh@tinyerp.com-20130516134304-md4kapvo1yt6q4c0 --- addons/event_sale/event_sale.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index 15e528dbaff..c561375dcf6 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -86,9 +86,9 @@ class sale_order_line(osv.osv): 'event_id': order_line.event_id.id, } message = _("The registration has been created for event %s from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name) - context.update({'sale_event': True, 'message': message }) + context.update({'mail_create_nolog': True, 'sale_event': True, 'message': message }) registration_id = registration_obj.create(cr, uid, dic, context=context) - registration_obj.create_send_note(cr, uid, registration_id, context=context) + registration_obj.message_post(cr, uid, registration_id, body=message, context=context) return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context) sale_order_line() @@ -96,14 +96,8 @@ sale_order_line() class event_registration(osv.osv): _inherit = 'event.registration' - # ---------------------------------------- - # OpenChatter methods and notifications - # ---------------------------------------- - - def create_send_note(self, cr, uid, ids, context=None): - if context.get("sale_event") and context.get("message"): - message = context.get("message") - self.message_post(cr, uid, ids, body=message, context=context) - else: - super(event_registration, self).create_send_note(cr, uid, ids, context=context) - return True + def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, content_subtype='html', **kwargs): + """ Overrides mail_thread message_post so that we can set the message note when + a new registration create on the event sale. + """ + return super(event_registration, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs) From 70f20e30d420474a3b619f3bda9a528e58630764 Mon Sep 17 00:00:00 2001 From: "Farid Ghanchi (OpenERP)" Date: Fri, 17 May 2013 10:28:59 +0530 Subject: [PATCH 08/10] [IMP] Improved code bzr revid: ggh@tinyerp.com-20130517045859-jnciw2w13z3u1eka --- addons/event_sale/event_sale.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index c561375dcf6..03da1458f04 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -85,10 +85,10 @@ class sale_order_line(osv.osv): 'origin': order_line.order_id.name, 'event_id': order_line.event_id.id, } - message = _("The registration has been created for event %s from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name) - context.update({'mail_create_nolog': True, 'sale_event': True, 'message': message }) + message = _("The registration has been created for event %s from the Sale Order %s. ") % (order_line.event_id.name, order_line.order_id.name) + context.update({'mail_create_nolog': True, 'message': message }) registration_id = registration_obj.create(cr, uid, dic, context=context) - registration_obj.message_post(cr, uid, registration_id, body=message, context=context) + registration_obj.message_post(cr, uid, [registration_id], body=message, context=context) return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context) sale_order_line() @@ -97,7 +97,7 @@ class event_registration(osv.osv): _inherit = 'event.registration' def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, content_subtype='html', **kwargs): - """ Overrides mail_thread message_post so that we can set the message note when - a new registration create on the event sale. - """ - return super(event_registration, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs) + """ Overrides mail_thread message_post so that we can set the message note when + a new registration create on the event sale. + """ + return super(event_registration, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs) From 48efb3b4d68080948396d2bf2352fc15062d2338 Mon Sep 17 00:00:00 2001 From: "Farid Ghanchi (OpenERP)" Date: Fri, 17 May 2013 15:57:32 +0530 Subject: [PATCH 09/10] [IMP] Remove override message_post methode bzr revid: ggh@tinyerp.com-20130517102732-ik68fh7bfv40lmee --- addons/event_sale/event_sale.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index 03da1458f04..7d5518cddea 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -92,12 +92,3 @@ class sale_order_line(osv.osv): return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context) sale_order_line() - -class event_registration(osv.osv): - _inherit = 'event.registration' - - def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, content_subtype='html', **kwargs): - """ Overrides mail_thread message_post so that we can set the message note when - a new registration create on the event sale. - """ - return super(event_registration, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, content_subtype=content_subtype, **kwargs) From 39024c023931364922d034634ef310873ff5b791 Mon Sep 17 00:00:00 2001 From: "Farid Ghanchi (OpenERP)" Date: Fri, 17 May 2013 16:04:56 +0530 Subject: [PATCH 10/10] [IMP] Improved code bzr revid: ggh@tinyerp.com-20130517103456-huif4hsynibg0uqb --- addons/event_sale/event_sale.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/event_sale/event_sale.py b/addons/event_sale/event_sale.py index 7d5518cddea..e1fb57fb93c 100644 --- a/addons/event_sale/event_sale.py +++ b/addons/event_sale/event_sale.py @@ -90,5 +90,3 @@ class sale_order_line(osv.osv): registration_id = registration_obj.create(cr, uid, dic, context=context) registration_obj.message_post(cr, uid, [registration_id], body=message, context=context) return super(sale_order_line, self).button_confirm(cr, uid, ids, context=context) - -sale_order_line()