From f9d81948bf4770f7aa8cd353e6f4d95fd2f33596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=80=D1=83=D0=B3=D0=BB=D0=BE=D0=B2=20=D0=94=D0=BC?= =?UTF-8?q?=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Thu, 15 Aug 2019 11:52:15 +0300 Subject: [PATCH 1/2] added param "site" in inventories_upload --- retailcrm/versions/v3.py | 6 +++++- retailcrm/versions/v4.py | 6 +++++- retailcrm/versions/v5.py | 7 ++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/retailcrm/versions/v3.py b/retailcrm/versions/v3.py index 8e26418..cc9409d 100644 --- a/retailcrm/versions/v3.py +++ b/retailcrm/versions/v3.py @@ -461,11 +461,15 @@ class Client(Base): return self.get('/store/inventories') - def inventories_upload(self, offers): + def inventories_upload(self, offers, site=None): """ :param offers: + :param site: :return: Response """ + if site is not None: + self.parameters['site'] = site + self.parameters['offers'] = json.dumps(offers) return self.post('/store/inventories/upload') diff --git a/retailcrm/versions/v4.py b/retailcrm/versions/v4.py index f247b4f..91b028d 100644 --- a/retailcrm/versions/v4.py +++ b/retailcrm/versions/v4.py @@ -522,11 +522,15 @@ class Client(Base): return self.get('/store/inventories') - def inventories_upload(self, offers): + def inventories_upload(self, offers, site=None): """ :param offers: + :param site: :return: Response """ + if site is not None: + self.parameters['site'] = site + self.parameters['offers'] = json.dumps(offers) return self.post('/store/inventories/upload') diff --git a/retailcrm/versions/v5.py b/retailcrm/versions/v5.py index d5452db..1749436 100644 --- a/retailcrm/versions/v5.py +++ b/retailcrm/versions/v5.py @@ -899,13 +899,18 @@ class Client(Base): return self.get('/store/inventories') - def inventories_upload(self, offers): + def inventories_upload(self, offers, site=None): """ :param offers: + :param site: :return: Response """ + if site is not None: + self.parameters['site'] = site + self.parameters['offers'] = json.dumps(offers) + return self.post('/store/inventories/upload') def prices_upload(self, prices): From 15d772079e18ee4068f913e210bfd8b32623a08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=80=D1=83=D0=B3=D0=BB=D0=BE=D0=B2=20=D0=94=D0=BC?= =?UTF-8?q?=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Thu, 15 Aug 2019 13:10:27 +0300 Subject: [PATCH 2/2] added init file in "versions" dir --- retailcrm/versions/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 retailcrm/versions/__init__.py diff --git a/retailcrm/versions/__init__.py b/retailcrm/versions/__init__.py new file mode 100644 index 0000000..e0bcbc7 --- /dev/null +++ b/retailcrm/versions/__init__.py @@ -0,0 +1,5 @@ +# coding=utf-8 + +""" +Init +""" \ No newline at end of file