Compare commits
2 Commits
77d626374f
...
6157328b80
Author | SHA1 | Date | |
---|---|---|---|
6157328b80 | |||
0b49554eb5 |
18
sale.py
18
sale.py
@ -204,9 +204,16 @@ class Sale(metaclass=PoolMeta):
|
|||||||
"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,
|
||||||
|
"quantity": str(-1 * line.quantity),
|
||||||
|
"unit": line.unit.symbol,
|
||||||
|
} for line in report.delete_lines if not line.printed]
|
||||||
|
=======
|
||||||
"product": line.product.name if line.type != 'title' else None,
|
"product": line.product.name if line.type != 'title' else None,
|
||||||
"quantity": line.quantity 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]
|
} for line in report.delete_lines if not line.impreso]
|
||||||
|
>>>>>>> 77d626374f847b8e54b81cc06f76b545e4014b29
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
@ -231,7 +238,11 @@ 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.impreso = True
|
line.impreso = True
|
||||||
|
>>>>>>> 77d626374f847b8e54b81cc06f76b545e4014b29
|
||||||
line.save()
|
line.save()
|
||||||
record.save()
|
record.save()
|
||||||
|
|
||||||
@ -277,7 +288,7 @@ class Sale(metaclass=PoolMeta):
|
|||||||
headers = {"accept": 'application/json',
|
headers = {"accept": 'application/json',
|
||||||
'Content-Type': 'application/json'}
|
'Content-Type': 'application/json'}
|
||||||
requests.post(
|
requests.post(
|
||||||
url, data=json.dumps(content), headers=headers)
|
url, data=json.dumps(content), headers=headers, timeout=5)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
@ -321,8 +332,9 @@ class Sale(metaclass=PoolMeta):
|
|||||||
'Content-Type': 'application/json'}
|
'Content-Type': 'application/json'}
|
||||||
cls.impreso([record])
|
cls.impreso([record])
|
||||||
|
|
||||||
requests.post(url, data=json.dumps(content),
|
requests.post(
|
||||||
headers=headers)
|
url, data=json.dumps(content),
|
||||||
|
headers=headers, timeout=5)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
|
Loading…
Reference in New Issue
Block a user