add bar button
This commit is contained in:
parent
62144b60ca
commit
8f079d4f65
19
sale.py
19
sale.py
@ -46,11 +46,26 @@ class Sale(metaclass=PoolMeta):
|
|||||||
|
|
||||||
content = {'content': customer_order[1].decode('utf-8')}
|
content = {'content': customer_order[1].decode('utf-8')}
|
||||||
headers = {"accept": 'application/json', 'Content-Type': 'application/json'}
|
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)
|
response = requests.post(url, data=json.dumps(content), headers=headers)
|
||||||
|
|
||||||
return response.status_code
|
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):
|
class Line(metaclass=PoolMeta):
|
||||||
"Sale Line Fast Food"
|
"Sale Line Fast Food"
|
||||||
|
7
sale.xml
7
sale.xml
@ -22,11 +22,16 @@
|
|||||||
<field name="string">Add Pizza</field>
|
<field name="string">Add Pizza</field>
|
||||||
<field name="model" search="[('model', '=', 'sale.sale')]"/>
|
<field name="model" search="[('model', '=', 'sale.sale')]"/>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.model.button" id="sale_customer_order_button">
|
<record model="ir.model.button" id="sale_order_kitchen_button">
|
||||||
<field name="name">kitchen</field>
|
<field name="name">kitchen</field>
|
||||||
<field name="string">Kitchen</field>
|
<field name="string">Kitchen</field>
|
||||||
<field name="model" search="[('model', '=', 'sale.sale')]"/>
|
<field name="model" search="[('model', '=', 'sale.sale')]"/>
|
||||||
</record>
|
</record>
|
||||||
|
<record model="ir.model.button" id="sale_order_bar_button">
|
||||||
|
<field name="name">bar</field>
|
||||||
|
<field name="string">Bar</field>
|
||||||
|
<field name="model" search="[('model', '=', 'sale.sale')]"/>
|
||||||
|
</record>
|
||||||
<record model="ir.action.report" id="report_customer_order">
|
<record model="ir.action.report" id="report_customer_order">
|
||||||
<field name="name">Customer Order</field>
|
<field name="name">Customer Order</field>
|
||||||
<field name="model">sale.sale</field>
|
<field name="model">sale.sale</field>
|
||||||
|
@ -8,5 +8,6 @@
|
|||||||
<field name="pizza_number"/>
|
<field name="pizza_number"/>
|
||||||
<button name="add_pizza"/>
|
<button name="add_pizza"/>
|
||||||
<button name="kitchen"/>
|
<button name="kitchen"/>
|
||||||
|
<button name="bar"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
Loading…
Reference in New Issue
Block a user