add bar button

This commit is contained in:
root
2023-07-11 19:26:23 +00:00
parent 62144b60ca
commit 8f079d4f65
3 changed files with 24 additions and 3 deletions

19
sale.py
View File

@@ -46,11 +46,26 @@ class Sale(metaclass=PoolMeta):
content = {'content': customer_order[1].decode('utf-8')}
headers = {"accept": 'application/json', 'Content-Type': 'application/json'}
url = "http://localhost:5000/print_ticket"
url = "http://localhost:5000/order_kitchen"
response = requests.post(url, data=json.dumps(content), headers=headers)
return response.status_code
@classmethod
@ModelView.button
def bar(cls, records):
pool = Pool()
Report = pool.get('sale.customer_order', type='report')
context = Transaction().context
customer_order = Report.execute(records, context)
content = {'content': customer_order[1].decode('utf-8')}
headers = {"accept": 'application/json', 'Content-Type': 'application/json'}
url = "http://localhost:5000/order_bar"
response = requests.post(url, data=json.dumps(content), headers=headers)
return response.status_code
class Line(metaclass=PoolMeta):
"Sale Line Fast Food"