definable end point for sales orders, and drafts

Needs tweaking, but sales orders can now be generated to a given end date.
Drafts too can be given a date, but also a datetime.

Sales orders defaut time to midnight the night before, while drafts
default to now, but can be given other end dates.

Change-Id: Id70227650c765bb477934ffa24ad5d4b99fc34e9
This commit is contained in:
adriant
2014-04-30 14:57:49 +12:00
parent 0744926112
commit cf9557a377
4 changed files with 50 additions and 18 deletions

View File

@@ -23,14 +23,14 @@ class Client(object):
except ConnectionError as e:
print e
def sales_order(self, tenants, draft):
def sales_order(self, tenants, end, draft):
if draft:
url = self.endpoint + "sales_draft"
else:
url = self.endpoint + "sales_order"
for tenant in tenants:
data = {"tenant": tenant}
data = {"tenant": tenant, 'end': end}
try:
response = requests.post(url,
headers={"Content-Type":