From 55cefcb8caa81b1518acb36467c654046d6676b9 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 10 Jul 2023 19:32:48 +0000 Subject: [PATCH] add button kitchen --- sale.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sale.py b/sale.py index 107ff0f..f32dfc2 100644 --- a/sale.py +++ b/sale.py @@ -45,11 +45,10 @@ class Sale(metaclass=PoolMeta): context = Transaction().context #customer_order = Report.execute(records, context) data = {"content": "Esto es una pruebas"} + headers = {"accept": 'application/json', 'Content-Type': 'application/json'} url = "http://localhost:5000/print_ticket" - response = requests.post(url, json=json.dumps(data), headers={'Content-Type': 'application/json'}) - #response = requests.post(url, json={"content": customer_order[1]}) + response = requests.post(url, data=json.dumps(data), headers=headers) - raise UserError(str(response)) if response.status_code == 200: message = response.Text raise UserError(str(message))