FIX connector_walmart next cursor should be all of the parameters from the value of the nextCursor

This commit is contained in:
Jared Kipe
2019-11-25 15:05:58 -08:00
parent 05df314483
commit 9c459e2cba
2 changed files with 4 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ class Walmart(object):
)) ))
elif response.status_code == 400: elif response.status_code == 400:
data = response.json() data = response.json()
if data["error"][0]["code"] == \ if data.get("error", [{}])[0].get("code", '') == \
"INVALID_TOKEN.GMP_GATEWAY_API": "INVALID_TOKEN.GMP_GATEWAY_API":
# Refresh the token as the current token has expired # Refresh the token as the current token has expired
self.authenticate() self.authenticate()

View File

@@ -4,6 +4,7 @@
import logging import logging
import odoo.addons.decimal_precision as dp import odoo.addons.decimal_precision as dp
from urllib.parse import parse_qs
from odoo import models, fields, api from odoo import models, fields, api
from odoo.addons.queue_job.job import job from odoo.addons.queue_job.job import job
@@ -161,7 +162,8 @@ class SaleOrderAdapter(Component):
:return: List :return: List
""" """
if next_cursor: if next_cursor:
arguments = {'nextCursor': next_cursor} # next_cursor looks like '?somefield=xxx&blah=yyy'
arguments = parse_qs(next_cursor.strip('?'))
else: else:
arguments = {'createdStartDate': from_date.isoformat()} arguments = {'createdStartDate': from_date.isoformat()}