diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 18a74503e96..df34447ee8d 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -242,12 +242,6 @@ class calendar_attendee(osv.osv): the_mailmess = mail_pool.browse(cr,uid,mail_id,context=context).mail_message_id mailmess_pool.write(cr,uid,[the_mailmess.id],vals,context=context) mail_ids.append(mail_id) - - -# -# if not attendee.partner_id.opt_out: -# if 'partner_to' in vals: -# del vals['partner_to'] #hack between mail.mail and template.mail -> tde if mail_ids: try: @@ -568,8 +562,6 @@ class calendar_alarm_manager(osv.osv): if LastFound: for alert in LastFound: self.do_mail_reminder(cr,uid,alert,context=context) - - #Purge all done def get_next_event(self,cr,uid,context=None): ajax_check_every_seconds = 300 @@ -627,31 +619,28 @@ class calendar_alarm_manager(osv.osv): 'declined':'red' } - for attendee in event.attendee_ids: + for attendee in event.attendee_ids: dummy,template_id = data_pool.get_object_reference(cr, uid, 'calendar', 'crm_email_template_meeting_reminder') dummy,act_id = data_pool.get_object_reference(cr, uid, 'calendar', "view_crm_meeting_calendar") - body = template_pool.browse(cr, uid, template_id, context=context).body_html - - #mail_from = tools.config.get('email_from',event.user_id.email) + if attendee.email: - local_context['att_obj'] = attendee + local_context['color'] = color local_context['action_id'] = self.pool.get('ir.actions.act_window').search(cr, uid, [('view_id','=',act_id)], context=context)[0] local_context['dbname'] = cr.dbname local_context['base_url'] = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context) - vals = template_pool.generate_email(cr, uid, template_id, attendee.event_id.id, context=local_context) + vals = template_pool.send_mail(cr, uid, template_id, attendee.id, context=local_context) + vals = {} + if ics_file: + vals['attachment_ids'] = [(0,0,{'name': 'invitation.ics', + 'datas_fname': 'invitation.ics', + 'datas': str(ics_file).encode('base64')})] vals['model'] = None #We don't want to have the mail in the tchatter while in queue! - vals['auto_delete'] = True #We don't need mail after it has been sended ! - - if (vals['email_to']== attendee.partner_id.email): - vals['email_to'] = '' - vals['recipient_ids'] = [(4,attendee.partner_id.id),] - - if not attendee.partner_id.opt_out: - if 'partner_to' in vals: - del vals['partner_to'] #hack between mail.mail and template.mail -> tde - mail_ids.append(mail_pool.create(cr, uid, vals, context=local_context)) + the_mailmess = mail_pool.browse(cr,uid,mail_id,context=context).mail_message_id + mailmess_pool.write(cr,uid,[the_mailmess.id],vals,context=context) + mail_ids.append(mail_id) + if mail_ids: try: res = mail_pool.send(cr, uid, mail_ids, context=local_context) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index d3b99736c05..19c360f0c81 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -416,13 +416,14 @@ class email_template(osv.osv): #Convert Partner_to (a string of ID) into recipient_ids' recipient_ids = [] - if 'partner_to' in values and values['partner_to']: - partner_to = safe_eval(values['partner_to']) -# if not hasattr(partner_to, '__iter__'): -# partner_to = [partner_to] - for partner_id in partner_to: - recipient_ids.append((4,partner_id)) - values['recipient_ids'] = recipient_ids + if 'partner_to' in values: + if values['partner_to']: + partner_to = safe_eval(values['partner_to']) + # if not hasattr(partner_to, '__iter__'): + # partner_to = [partner_to] + for partner_id in partner_to: + recipient_ids.append((4,partner_id)) + values['recipient_ids'] = recipient_ids del values['partner_to'] attachment_ids = values.pop('attachment_ids', []) diff --git a/addons/google_account/controllers/main.py b/addons/google_account/controllers/main.py index 7576351e470..8e66f787e3b 100644 --- a/addons/google_account/controllers/main.py +++ b/addons/google_account/controllers/main.py @@ -21,7 +21,7 @@ class google_auth(http.Controller): registry = openerp.modules.registry.RegistryManager.get(dbname) with registry.cursor() as cr: - if kw.get('code'): + if kw.get('code',False): registry.get('google.%s' % service).set_all_tokens(cr,request.session.uid,kw['code']) return werkzeug.utils.redirect(url_return) diff --git a/addons/google_account/google_account.py b/addons/google_account/google_account.py index 35a3da54971..da5396781e2 100644 --- a/addons/google_account/google_account.py +++ b/addons/google_account/google_account.py @@ -100,7 +100,7 @@ class google_service(osv.osv_memory): 'client_id': client_id, 'client_secret': client_secret, 'grant_type' : 'authorization_code', - #'redirect_uri': base_url + '/google_account/authentication' + 'redirect_uri': base_url + '/google_account/authentication' } headers = {"content-type": "application/x-www-form-urlencoded"} diff --git a/addons/google_calendar/res_config_view.xml b/addons/google_calendar/res_config_view.xml index 1d9116358ba..66b7256cbba 100644 --- a/addons/google_calendar/res_config_view.xml +++ b/addons/google_calendar/res_config_view.xml @@ -30,25 +30,22 @@
  • - In the menu on left side, select the sub menu 'Registered apps' (from menu APIs and auth) and click on button "Register APP". -
    Fill in the Name of application and check that the platform is well on 'Web Application' before to click on 'Register" + In the menu on left side, select the sub menu 'Credentials' (from menu APIs and auth) and click on button 'Create New Client ID'

    -
    -
  • -
  • - Now, you can click on "OAuth 2.0 Client ID" and see your Client ID and your Client Secret. +
  • +
  • Fill in the Name of application and check that the platform is well on 'Web Application'.

    You should now configure the allowed pages on which you will be redirected. To do it, you need to complete the field "Redirect RI" and set as value (your own domain followed by "/google_account/authentication") :
    ==> -

    -
  • -
  • One the uri allowed, you need to regenerate your private token by clicking on "Generate". -
    Once done, you will have the both informations that you need to insert in the 2 fields below ! +
    You can now click on 'Create Client ID' +

    +
  • +
  • Once done, you will have the both informations (Client ID and Client Secret) that you need to insert in the 2 fields below !

  • - Remark : You can, if you want, personalize the consent screen that your users will see by clicking on "update" below "Consent Screen". -

    + Remark : You can, if you want, personalize the consent screen that your users will see by clicking on "Consent Screen" in the left menu. +

  • Return at Top diff --git a/addons/google_calendar/static/src/img/setup_06.png b/addons/google_calendar/static/src/img/setup_06.png index a536ecddefc..c8aa076da6d 100644 Binary files a/addons/google_calendar/static/src/img/setup_06.png and b/addons/google_calendar/static/src/img/setup_06.png differ diff --git a/addons/google_calendar/static/src/img/setup_07.png b/addons/google_calendar/static/src/img/setup_07.png index 0be1567bdda..cd1b10edd02 100644 Binary files a/addons/google_calendar/static/src/img/setup_07.png and b/addons/google_calendar/static/src/img/setup_07.png differ diff --git a/addons/google_calendar/static/src/img/setup_08.png b/addons/google_calendar/static/src/img/setup_08.png index df2f2a3562c..c66cdbb2d9c 100644 Binary files a/addons/google_calendar/static/src/img/setup_08.png and b/addons/google_calendar/static/src/img/setup_08.png differ diff --git a/addons/google_calendar/static/src/img/setup_09.png b/addons/google_calendar/static/src/img/setup_09.png index e8cb4d8084d..e537775fc1c 100644 Binary files a/addons/google_calendar/static/src/img/setup_09.png and b/addons/google_calendar/static/src/img/setup_09.png differ diff --git a/addons/google_calendar/static/src/img/setup_10.png b/addons/google_calendar/static/src/img/setup_10.png deleted file mode 100644 index e537775fc1c..00000000000 Binary files a/addons/google_calendar/static/src/img/setup_10.png and /dev/null differ