如何解决Odoo 12 Google Calendar Addon中的错误400错误请求

时间:2020-08-10 14:47:07

标签: google-calendar-api odoo

当我尝试与Odoo 12中的Google日历同步时,

Odoo sync Button

我收到此错误:

Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/google_calendar/controllers/main.py", line 43, in sync_data
    return GoogleCal.with_context(context).synchronize_events()
  File "/usr/lib/python3/dist-packages/odoo/addons/google_calendar/models/google_calendar.py", line 608, in synchronize_events
    new_ids += recs.create_new_events()
  File "/usr/lib/python3/dist-packages/odoo/addons/google_calendar/models/google_calendar.py", line 642, in create_new_events
    status, response, ask_time = self.create_an_event(att.event_id)
  File "/usr/lib/python3/dist-packages/odoo/addons/google_calendar/models/google_calendar.py", line 267, in create_an_event
    return self.env['google.service']._do_request(url, data_json, headers, type='POST')
  File "/usr/lib/python3/dist-packages/odoo/addons/google_account/models/google_service.py", line 192, in _do_request
    raise error
  File "/usr/lib/python3/dist-packages/odoo/addons/google_account/models/google_service.py", line 173, in _do_request
    res.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.googleapis.com/calendar/v3/calendars/primary/events?fields=id%2Cupdated&access_token=xxx

Google API返回以下错误:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalidParameter",
    "message": "Invalid field selection id",
    "locationType": "parameter",
    "location": "fields"
   }
  ],
  "code": 400,
  "message": "Invalid field selection id"
 }
}

有没有办法解决这个问题?还是应该在Odoo GitHub上发布问题?

提前谢谢!

0 个答案:

没有答案