Merge branch 'imp/11.0/walmart_oauth' into '11.0-test'

TEST: imp/11.0/walmart_oauth

See merge request hibou-io/hibou-odoo/suite!28
This commit is contained in:
Jared Kipe
2019-08-22 21:49:14 +00:00
2 changed files with 5 additions and 4 deletions

View File

@@ -389,12 +389,12 @@ class Orders(Resource):
def acknowledge(self, id):
url = self.url + '/%s/acknowledge' % id
return self.send_request(method='POST', url=url)
return self.connection.send_request(method='POST', url=url)
def cancel(self, id, lines):
url = self.url + '/%s/cancel' % id
return self.send_request(
method='POST', url=url, data=self.get_cancel_payload(lines))
return self.connection.send_request(
method='POST', url=url, body=self.get_cancel_payload(lines))
def get_cancel_payload(self, lines):
element = ElementMaker(

View File

@@ -172,7 +172,8 @@ class SaleOrderAdapter(Component):
if not 'list' in orders_response:
return []
next = orders_response['list']['meta']['nextCursor']
# 'meta' may not be there (though it is in the example on the API docs even when nextCursor is none)
next = orders_response.get('list', {}).get('meta', {}).get('nextCursor')
if next:
self.env[self._apply_on].with_delay().import_batch(
self.backend_record,