diff options
| author | jke-openerp <jke@openerp.com> | 2013-12-19 18:45:36 +0100 |
|---|---|---|
| committer | jke-openerp <jke@openerp.com> | 2013-12-19 18:45:36 +0100 |
| commit | 4a1208b39bdb5866ea8fcc1419969bdb7255e199 (patch) | |
| tree | 6c8c375c0ba2efd1c86fbc2b69316c7ed369cc82 /addons | |
| parent | 59c932477edf0ccff68dfa18e97a3bd76b6e251d (diff) | |
[IMP] Redo tuto to get api key, because Google have changed console UI during the dev
bzr revid: jke@openerp.com-20131219174536-msjd005fxhxgl9qq
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/calendar/calendar.py | 37 | ||||
| -rw-r--r-- | addons/email_template/email_template.py | 15 | ||||
| -rw-r--r-- | addons/google_account/controllers/main.py | 2 | ||||
| -rw-r--r-- | addons/google_account/google_account.py | 2 | ||||
| -rw-r--r-- | addons/google_calendar/res_config_view.xml | 21 | ||||
| -rw-r--r-- | addons/google_calendar/static/src/img/setup_06.png | bin | 13959 -> 36793 bytes | |||
| -rw-r--r-- | addons/google_calendar/static/src/img/setup_07.png | bin | 23294 -> 43094 bytes | |||
| -rw-r--r-- | addons/google_calendar/static/src/img/setup_08.png | bin | 31734 -> 46112 bytes | |||
| -rw-r--r-- | addons/google_calendar/static/src/img/setup_09.png | bin | 17030 -> 12511 bytes | |||
| -rw-r--r-- | addons/google_calendar/static/src/img/setup_10.png | bin | 12511 -> 0 bytes |
10 files changed, 32 insertions, 45 deletions
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 @@ <br/> <img src='/google_calendar/static/src/img/setup_05.png' class='calendar_img_tuto'/> </li> <li> - In the menu on left side, select the sub menu <b>'Registered apps'</b> (from menu APIs and auth) and click on button "Register APP". - <br/> Fill in the Name of application and check that the platform is well on <b>'Web Application'</b> before to click on <b>'Register"</b> + In the menu on left side, select the sub menu <b>'Credentials'</b> (from menu APIs and auth) and click on button <b>'Create New Client ID'</b> <br/><br/> <img src='/google_calendar/static/src/img/setup_06.png' class='calendar_img_tuto'/> - <br/> <img src='/google_calendar/static/src/img/setup_07.png' class='calendar_img_tuto'/> - </li> - <li> - Now, you can click on <b>"OAuth 2.0 Client ID"</b> and see your <u><i>Client ID</i></u> and your <u><i>Client Secret</i></u>. + </li> + <li> Fill in the Name of application and check that the platform is well on <b>'Web Application'</b>.<br/> <br/> You should now configure the allowed pages on which you will be redirected. To do it, you need to complete the field <b>"Redirect RI"</b> and set as value (your own domain followed by <i>"/google_account/authentication"</i>) : <br/>==> <b><field name="server_uri" readonly="1" style='display:inline'/></b> - <br/><br/><img src='/google_calendar/static/src/img/setup_09.png' class='calendar_img_tuto'/> - </li> - <li>One the uri allowed, you need to regenerate your private token by clicking on "Generate". - <br/>Once done, you will have the both informations that you need to insert in the 2 fields below ! + <br/> You can now click on <b>'Create Client ID'</b> + <br/><br/> <img src='/google_calendar/static/src/img/setup_07.png' class='calendar_img_tuto'/> + </li> + <li>Once done, you will have the both informations (<b>Client ID</b> and <b>Client Secret</b>) that you need to insert in the 2 fields below ! <br/><br/> <img src='/google_calendar/static/src/img/setup_08.png' class='calendar_img_tuto'/> </li> <li> - Remark : You can, if you want, personalize the consent screen that your users will see by clicking on "update" below <b>"Consent Screen"</b>. - <br/><br/> <img src='/google_calendar/static/src/img/setup_10.png' class='calendar_img_tuto'/> + Remark : You can, if you want, personalize the consent screen that your users will see by clicking on <b>"Consent Screen"</b> in the left menu. + <br/><br/> <img src='/google_calendar/static/src/img/setup_09.png' class='calendar_img_tuto'/> </li> <a href="#" class="oe_link">Return at Top</a> diff --git a/addons/google_calendar/static/src/img/setup_06.png b/addons/google_calendar/static/src/img/setup_06.png Binary files differindex a536ecddefc..c8aa076da6d 100644 --- a/addons/google_calendar/static/src/img/setup_06.png +++ b/addons/google_calendar/static/src/img/setup_06.png diff --git a/addons/google_calendar/static/src/img/setup_07.png b/addons/google_calendar/static/src/img/setup_07.png Binary files differindex 0be1567bdda..cd1b10edd02 100644 --- a/addons/google_calendar/static/src/img/setup_07.png +++ b/addons/google_calendar/static/src/img/setup_07.png diff --git a/addons/google_calendar/static/src/img/setup_08.png b/addons/google_calendar/static/src/img/setup_08.png Binary files differindex df2f2a3562c..c66cdbb2d9c 100644 --- a/addons/google_calendar/static/src/img/setup_08.png +++ b/addons/google_calendar/static/src/img/setup_08.png diff --git a/addons/google_calendar/static/src/img/setup_09.png b/addons/google_calendar/static/src/img/setup_09.png Binary files differindex e8cb4d8084d..e537775fc1c 100644 --- a/addons/google_calendar/static/src/img/setup_09.png +++ b/addons/google_calendar/static/src/img/setup_09.png diff --git a/addons/google_calendar/static/src/img/setup_10.png b/addons/google_calendar/static/src/img/setup_10.png Binary files differdeleted file mode 100644 index e537775fc1c..00000000000 --- a/addons/google_calendar/static/src/img/setup_10.png +++ /dev/null |
