Fix: string ip_addres
This commit is contained in:
parent
6157328b80
commit
6d97f92fcd
28
sale.py
28
sale.py
@ -197,23 +197,17 @@ class Sale(metaclass=PoolMeta):
|
|||||||
data["zone"] = report.zone.name if report.zone else ""
|
data["zone"] = report.zone.name if report.zone else ""
|
||||||
data["table"] = report.table.name if report.table else ""
|
data["table"] = report.table.name if report.table else ""
|
||||||
data["lines"] = [{
|
data["lines"] = [{
|
||||||
'type': line.type,
|
"type": line.type,
|
||||||
"product": line.product.name if line.type != 'title' else None,
|
"product": line.product.name if line.type != "title" else None,
|
||||||
"description": line.description if line.type != 'title' else None,
|
"description": line.description if line.type != "title" else None,
|
||||||
"quantity": line.quantity if line.type != 'title' else None,
|
"quantity": line.quantity if line.type != "title" else None,
|
||||||
"uom": line.unit.name if line.type != 'title' else None}
|
"uom": line.unit.name if line.type != "title" else None}
|
||||||
for line in report.lines if not line.impreso]
|
for line in report.lines if not line.impreso]
|
||||||
data["deleted_lines"] = [{
|
data["deleted_lines"] = [{
|
||||||
<<<<<<< HEAD
|
|
||||||
"product": line.product.name,
|
"product": line.product.name,
|
||||||
"quantity": str(-1 * line.quantity),
|
"quantity": str(-1 * line.quantity),
|
||||||
"unit": line.unit.symbol,
|
"unit": line.unit.symbol
|
||||||
} for line in report.delete_lines if not line.printed]
|
} for line in report.delete_lines if not line.printed]
|
||||||
=======
|
|
||||||
"product": line.product.name if line.type != 'title' else None,
|
|
||||||
"quantity": line.quantity if line.type != 'title' else None,
|
|
||||||
} for line in report.delete_lines if not line.impreso]
|
|
||||||
>>>>>>> 77d626374f847b8e54b81cc06f76b545e4014b29
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@ -238,11 +232,7 @@ class Sale(metaclass=PoolMeta):
|
|||||||
line.save()
|
line.save()
|
||||||
|
|
||||||
for line in record.delete_lines:
|
for line in record.delete_lines:
|
||||||
<<<<<<< HEAD
|
|
||||||
line.printed = True
|
line.printed = True
|
||||||
=======
|
|
||||||
line.impreso = True
|
|
||||||
>>>>>>> 77d626374f847b8e54b81cc06f76b545e4014b29
|
|
||||||
line.save()
|
line.save()
|
||||||
record.save()
|
record.save()
|
||||||
|
|
||||||
@ -321,7 +311,7 @@ class Sale(metaclass=PoolMeta):
|
|||||||
|
|
||||||
if printer.type_ == 'network':
|
if printer.type_ == 'network':
|
||||||
content["printer_type"] = "Network"
|
content["printer_type"] = "Network"
|
||||||
content["ip_printer"] = str(printer.ip_address),
|
content["ip_printer"] = str(printer.ip_address)
|
||||||
else:
|
else:
|
||||||
if printer.type_ == 'usb':
|
if printer.type_ == 'usb':
|
||||||
content["printer_type"] = "USB"
|
content["printer_type"] = "USB"
|
||||||
@ -333,8 +323,8 @@ class Sale(metaclass=PoolMeta):
|
|||||||
cls.impreso([record])
|
cls.impreso([record])
|
||||||
|
|
||||||
requests.post(
|
requests.post(
|
||||||
url, data=json.dumps(content),
|
url, data=str(json.dumps(content)),
|
||||||
headers=headers, timeout=5)
|
headers=headers)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
|
Loading…
Reference in New Issue
Block a user