Browse Source

Jan 22 [UPDT] : Updated 'pos_kitchen_screen_odoo'

pull/302/head
AjmalCybro 2 years ago
parent
commit
11a9f54894
  1. 4
      pos_kitchen_screen_odoo/__manifest__.py
  2. 67
      pos_kitchen_screen_odoo/models/pos_orders.py
  3. 22
      pos_kitchen_screen_odoo/static/src/css/dashboard.css
  4. 152
      pos_kitchen_screen_odoo/static/src/js/dashboard_action.js
  5. 136
      pos_kitchen_screen_odoo/static/src/js/kitchen_screen.js
  6. 244
      pos_kitchen_screen_odoo/static/src/xml/dashboard_templates.xml
  7. 2
      pos_kitchen_screen_odoo/views/kitchen_screen_views.xml

4
pos_kitchen_screen_odoo/__manifest__.py

@ -39,7 +39,7 @@
'so that staff can see the information that is most '
'important to them.',
'category': 'Point Of Sale',
'version': '16.0.1.0.0',
'version': '16.0.1.0.1',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
@ -63,7 +63,7 @@
],
'web.assets_backend': [
'pos_kitchen_screen_odoo/static/src/css/dashboard.css',
'pos_kitchen_screen_odoo/static/src/js/dashboard_action.js',
'pos_kitchen_screen_odoo/static/src/js/kitchen_screen.js',
'pos_kitchen_screen_odoo/static/src/xml/dashboard_templates.xml',
'pos_kitchen_screen_odoo/static/src/js/fields_load.js',
'https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js',

67
pos_kitchen_screen_odoo/models/pos_orders.py

@ -42,6 +42,13 @@ class PosOrder(models.Model):
def write(self, vals):
"""Super the write function for adding order status in vals"""
message = {
'res_model': self._name,
'message': 'pos_order_created'
}
self.env["bus.bus"]._sendone('pos_order_created',
"notification",
message)
for order in self:
if order.order_status == "waiting" and vals.get(
"order_status") != "ready":
@ -54,6 +61,14 @@ class PosOrder(models.Model):
@api.model_create_multi
def create(self, vals_list):
"""Override create function for the validation of the order"""
"""Override create function for the validation of the order"""
message = {
'res_model': self._name,
'message': 'pos_order_created'
}
self.env["bus.bus"]._sendone('pos_order_created',
"notification",
message)
for vals in vals_list:
pos_orders = self.search(
[("pos_reference", "=", vals["pos_reference"])])
@ -78,12 +93,18 @@ class PosOrder(models.Model):
def get_details(self, shop_id, order=None):
"""For getting the kitchen orders for the cook"""
dic = order
if order:
orders = self.search([("pos_reference", "=", order)])
orders = self.search(
[("pos_reference", "=", order[0]['pos_reference'])])
if not orders:
self.create(dic)
else:
orders.lines = False
orders.lines = dic[0]['lines']
kitchen_screen = self.env["kitchen.screen"].sudo().search(
[("pos_config_id", "=", shop_id)])
pos_orders = self.env["pos.order.line"].search(
["&", ("is_cooking", "=", True),
("product_id.pos_categ_id", "in",
@ -96,7 +117,6 @@ class PosOrder(models.Model):
[rec.id for rec in kitchen_screen.pos_categ_ids])])
values = {"orders": pos.read(), "order_lines": pos_lines.read()}
return values
def action_pos_order_paid(self):
"""Supering the action_pos_order_paid function for setting its kitchen
order and setting the order reference"""
@ -119,36 +139,35 @@ class PosOrder(models.Model):
if self.order_status == "ready":
self.is_cooking = False
def order_progress_draft(self, id):
def order_progress_draft(self):
"""Calling function from js to change the order status"""
order = self.browse(int(id))
order.order_status = "waiting"
for line in order.lines:
self.order_status = "waiting"
for line in self.lines:
if line.order_status != "ready":
line.order_status = "waiting"
def order_progress_cancel(self, id):
def order_progress_cancel(self):
"""Calling function from js to change the order status"""
order = self.browse(int(id))
order.order_status = "cancel"
for line in order.lines:
# order = self.browse(int(id))
self.order_status = "cancel"
for line in self.lines:
if line.order_status != "ready":
line.order_status = "cancel"
def order_progress_change(self, id):
def order_progress_change(self):
"""Calling function from js to change the order status"""
order = self.browse(int(id))
kitchen_screen = self.env["kitchen.screen"].search(
[("pos_config_id", "=", order.config_id.id)])
[("pos_config_id", "=", self.config_id.id)])
stage = []
for line in order.lines:
if line.product_id.pos_categ_id.id in \
[rec.id for rec in kitchen_screen.pos_categ_ids]:
stage.append(line.order_status)
for line in self.lines:
for categ in line.product_id.pos_categ_id:
if categ.id in [rec.id for rec in
kitchen_screen.pos_categ_ids]:
stage.append(line.order_status)
if "waiting" in stage or "draft" in stage:
order.order_status = "ready"
self.order_status = "ready"
else:
order.order_status = "ready"
self.order_status = "ready"
def check_order(self, order_name):
"""Calling function from js to know status of the order"""
@ -157,6 +176,8 @@ class PosOrder(models.Model):
[('pos_config_id', '=', pos_order.config_id.id)])
if kitchen_order:
if pos_order.order_status != 'ready':
if pos_order.order_status == 'cancel':
return False
return True
else:
return False
@ -193,7 +214,9 @@ class PosOrderLine(models.Model):
})
return res
def order_progress_change(self, id):
def order_progress_change(self):
"""Calling function from js to change the order_line status"""
order_line = self.browse(int(id))
order_line.order_status = 'ready'
if self.order_status == 'ready':
self.order_status = 'waiting'
else:
self.order_status = 'ready'

22
pos_kitchen_screen_odoo/static/src/css/dashboard.css

@ -575,6 +575,7 @@ select {
display: block;
}
.kitchen .top_bar ul li a span {
margin-left: 15px;
color: var(--draft);
@ -628,6 +629,10 @@ select {
width: 45px;
border-radius: 5px;
margin-right: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.kitchen .screen_info .wrapper .card .card-header .left .status h4 {
@ -650,6 +655,13 @@ select {
.kitchen .screen_info .wrapper .card .card-header .left .status .c_white {
color: var(--white-color);
}
@media (max-width: 1287px) {
/* Responsive styles */
.kitchen .screen_info .wrapper .card .card-header .right {
padding-top:0px;
}
}
.kitchen .screen_info .wrapper .card .card-header .right {
padding-top:8px;
}
@ -686,3 +698,13 @@ padding-top:8px;
font-weight: 700;
margin-right: 5px;
}
.kitchen_order_count{
display: flex;
align-items: center;
justify-content: center; margin-top: 10px;
font-size: 16px !important;
border-radius: 5px !important;
font-weight: bold !important;
background-color: #FA3E3E;
color:white !important;
}

152
pos_kitchen_screen_odoo/static/src/js/dashboard_action.js

@ -1,152 +0,0 @@
odoo.define('pos_kitchen_screen_odoo.dashboard_action', function(require) {
"use strict";
var AbstractAction = require('web.AbstractAction');
var core = require('web.core');
document.write(
unescape("%3Cscript src='https://cdn.jsdelivr.net/npm/chart.js' type='text/javascript'%3E%3C/script%3E"));
const {
loadBundle
} = require("@web/core/assets");
var QWeb = core.qweb;
var rpc = require('web.rpc');
//extending abstract actions for the dashboard
var KitchenCustomDashBoard = AbstractAction.extend({
template: 'KitchenCustomDashBoard',
events: {
'click .cancel_order': 'cancel_order',
'click .accept_order': 'accept_order',
'click .accept_order_line': 'accept_order_line',
'click .done_order': 'done_order',
'click .ready_stage': 'ready_stage',
'click .waiting_stage': 'waiting_stage',
'click .draft_stage': 'draft_stage',
},
//set up the dashboard template and fetch the data every 2 seconds from the backend for the dashboard
init: function(parent, context) {
var self = this;
this._super(parent, context);
setInterval(function() {
self.fetch_data();
}, 1000);
this.dashboards_templates = ['KitchenOrder'];
this.shop_id = context.context.default_lead_id;
},
//returning the fetched data
willStart: function() {
var self = this;
return Promise.all([loadBundle(this), this._super()]).then(function() {
return self.fetch_data();
});
},
//rendering the dashboard every 2 seconds
start: function() {
var self = this;
this.set("title", 'Dashboard');
return this._super().then(function() {
self.render_dashboards();
setInterval(function() {
self.render_dashboards();
}, 1000);
});
},
//Used to render the dashboard
render_dashboards: function() {
var self = this;
console.log('render_dashboards',self)
_.each(this.dashboards_templates, function(template) {
self.$('.o_pj_dashboard').html(QWeb.render(template, {
widget: self
}));
});
},
// fetch pos order details
fetch_data: function() {
var self = this;
var def1 = self._rpc({
model: 'pos.order',
method: 'get_details',
args: [
[], self.shop_id, []
],
}).then(function(result) {
self.total_room = result['orders'];
self.lines = result['order_lines'];
});
return $.when(def1);
},
// cancel the order from the kitchen
cancel_order: function(e) {
var input_id = this.$("#" + e.target.id).val();
rpc.query({
model: 'pos.order',
method: 'order_progress_cancel',
args: [
[], input_id
]
})
},
// accept the order from the kitchen
accept_order: function(e) {
var input_id = this.$("#" + e.target.id).val();
ScrollReveal().reveal("#" + e.target.id, {
delay: 1000,
duration: 2000,
opacity: 0,
distance: "50%",
origin: "top",
reset: true,
interval: 600,
});
rpc.query({
model: 'pos.order',
method: 'order_progress_draft',
args: [
[], input_id
]
})
},
//set the stage is ready to see the completed stage orders
ready_stage: function(e) {
var self = this;
self.stages = 'ready';
},
//set the stage is waiting to see the ready stage orders
waiting_stage: function(e) {
var self = this;
self.stages = 'waiting';
},
//set the stage is draft to see the cooking stage orders
draft_stage: function(e) {
var self = this;
self.stages = 'draft';
},
// change the status of the order from the kitchen
done_order: function(e) {
var input_id = this.$("#" + e.target.id).val();
rpc.query({
model: 'pos.order',
method: 'order_progress_change',
args: [
[], input_id
]
});
},
// change the status of the product from the kitchen
accept_order_line: function(e) {
var input_id = this.$("#" + e.target.id).val();
rpc.query({
model: 'pos.order.line',
method: 'order_progress_change',
args: [
[], input_id
]
})
},
});
core.action_registry.add('kitchen_custom_dashboard_tags', KitchenCustomDashBoard);
return KitchenCustomDashBoard;
});

136
pos_kitchen_screen_odoo/static/src/js/kitchen_screen.js

@ -0,0 +1,136 @@
/** @odoo-module */
import { registry } from "@web/core/registry";
const { Component, useState } = owl;
import { useService } from "@web/core/utils/hooks";
class kitchen_screen_dashboard extends Component {
setup() {
this.busService = useService('bus_service')
this.busService.addChannel("pos_order_created");
this.busService.addEventListener('notification', this.onPosOrderCreation.bind(this));
this.action = useService("action");
this.rpc = useService("rpc");
this.orm = useService("orm");
var self=this
this.state = useState({
order_details: [],
shop_id:[],
stages: 'draft',
draft_count:[],
waiting_count:[],
ready_count:[],
lines:[]
});
var session_shop_id;
//if refreshing the page then the last passed context (shop id)
//save to the session storage
if (this.props.action.context.default_shop_id) {
sessionStorage.setItem('shop_id', this.props.action.context.default_shop_id);
this.shop_id = this.props.action.context.default_shop_id;
session_shop_id = sessionStorage.getItem('shop_id');
} else {
session_shop_id = sessionStorage.getItem('shop_id');
this.shop_id = parseInt(session_shop_id, 10);;
}
self.orm.call("pos.order", "get_details", ["", self.shop_id,""]).then(function(result) {
self.state.order_details = result['orders']
self.state.lines = result['order_lines']
self.state.shop_id=self.shop_id
self.state.draft_count=self.state.order_details.filter((order) => order.order_status=='draft' && order.config_id[0]==self.state.shop_id).length
self.state.waiting_count=self.state.order_details.filter((order) => order.order_status=='waiting' && order.config_id[0]==self.state.shop_id).length
self.state.ready_count=self.state.order_details.filter((order) => order.order_status=='ready' && order.config_id[0]==self.state.shop_id).length
});
}
//Calling the onPosOrderCreation when an order is created or edited on the backend and return the notification
onPosOrderCreation(message){
let payload = message.detail[0].payload
var self=this
if(payload.message == "pos_order_created" && payload.res_model == "pos.order"){
self.orm.call("pos.order", "get_details", ["", self.shop_id,""]).then(function(result) {
self.state.order_details = result['orders']
self.state.lines = result['order_lines']
self.state.shop_id=self.shop_id
self.state.draft_count=self.state.order_details.filter((order) => order.order_status=='draft' && order.config_id[0]==self.state.shop_id).length
self.state.waiting_count=self.state.order_details.filter((order) => order.order_status=='waiting' && order.config_id[0]==self.state.shop_id).length
self.state.ready_count=self.state.order_details.filter((order) => order.order_status=='ready' && order.config_id[0]==self.state.shop_id).length
});
}
}
// cancel the order from the kitchen
cancel_order(e) {
var input_id = $("#" + e.target.id).val();
this.orm.call("pos.order", "order_progress_cancel", [Number(input_id)])
var current_order = this.state.order_details.filter((order) => order.id==input_id)
if(current_order){
current_order[0].order_status = 'cancel'
}
}
// accept the order from the kitchen
accept_order(e) {
var input_id = $("#" + e.target.id).val();
ScrollReveal().reveal("#" + e.target.id, {
delay: 1000,
duration: 2000,
opacity: 0,
distance: "50%",
origin: "top",
reset: true,
interval: 600,
});
var self=this
this.orm.call("pos.order", "order_progress_draft", [Number(input_id)])
var current_order = this.state.order_details.filter((order) => order.id==input_id)
if(current_order){
current_order[0].order_status = 'waiting'
}
}
// set the stage is ready to see the completed stage orders
ready_stage(e) {
var self = this;
self.state.stages = 'ready';
}
//set the stage is waiting to see the ready stage orders
waiting_stage(e) {
var self = this;
self.state.stages = 'waiting';
}
//set the stage is draft to see the cooking stage orders
draft_stage(e) {
var self = this;
self.state.stages = 'draft';
}
// change the status of the order from the kitchen
done_order(e) {
var self = this;
var input_id = $("#" + e.target.id).val();
this.orm.call("pos.order", "order_progress_change", [Number(input_id)])
var current_order = this.state.order_details.filter((order) => order.id==input_id)
if(current_order){
current_order[0].order_status = 'ready'
}
}
// change the status of the product from the kitchen
accept_order_line(e) {
var input_id = $("#" + e.target.id).val();
this.orm.call("pos.order.line", "order_progress_change", [Number(input_id)])
var current_order_line=this.state.lines.filter((order_line) => order_line.id==input_id)
if (current_order_line){
if (current_order_line[0].order_status == 'ready'){
current_order_line[0].order_status = 'waiting'
}
else{
current_order_line[0].order_status = 'ready'
}
}
}
}
kitchen_screen_dashboard.template = 'KitchenCustomDashBoard';
registry.category("actions").add("kitchen_custom_dashboard_tags", kitchen_screen_dashboard);

244
pos_kitchen_screen_odoo/static/src/xml/dashboard_templates.xml

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<template>
<!--Template for Kitchen order stages -->
<t t-name="KitchenCustomDashBoard">
<t t-name="KitchenCustomDashBoard" owl="1">
<header>
<div class="kitchen">
<div id="kitchen_screen" class="kitchen">
<div class="body_wrapper">
<div class="container">
<div class="top_bar">
@ -20,9 +20,20 @@
fill="#545454"/>
</svg>
</div>
<span class="draft draft_stage">
<span class="draft draft_stage"
t-on-click="(e) => this.draft_stage(e)">
Cooking
</span>
<t t-if="state.draft_count > 0">
<span class="ms-2 px-2 fw-bold rounded kitchen_order_count">
<t t-esc="state.draft_count"/>
</span>
</t>
<t t-else="">
<span class="ms-2 px-2 fw-bold rounded kitchen_order_count">
0
</span>
</t>
</a>
</li>
<li>
@ -67,9 +78,20 @@
</defs>
</svg>
</div>
<span class="cooking waiting_stage">
<span class="cooking waiting_stage"
t-on-click="(e) => this.waiting_stage(e)">
Ready
</span>
<t t-if="state.waiting_count > 0">
<span class="ms-2 px-2 fw-bold rounded kitchen_order_count">
<t t-esc="state.waiting_count"/>
</span>
</t>
<t t-else="">
<span class="ms-2 px-2 fw-bold rounded kitchen_order_count">
0
</span>
</t>
</a>
</li>
<li>
@ -97,33 +119,48 @@
</defs>
</svg>
</div>
<span class="completed ready_stage">
<span class="completed ready_stage"
t-on-click="(e) => this.ready_stage(e)">
Completed
</span>
<t t-if="state.ready_count > 0">
<span class="ms-2 px-2 fw-bold rounded kitchen_order_count">
<t t-esc="state.ready_count"/>
</span>
</t>
<t t-else="">
<span class="ms-2 px-2 fw-bold rounded kitchen_order_count">
0
</span>
</t>
</a>
</li>
</ul>
</div>
</div>
<div class="container o_pj_dashboard"/>
<div class="container o_pj_dashboard">
<t t-call="KitchenOrder"/>
</div>
</div>
</div>
</header>
</t>
<!--Template for Kitchen Orders in the kitchen screen -->
<t t-name="KitchenOrder">
<t t-name="KitchenOrder" owl="1">
<section class="screen_info custom_padding_top">
<div class="wrapper">
<div class="container-fluid">
<div class="row">
<t t-foreach="widget.total_room" t-as="order">
<t t-if="widget.shop_id==order.config_id[0]">
<t t-if="widget.stages=='ready'">
<t t-foreach="state.order_details" t-as="order"
t-key="order.id">
<t t-if="state.shop_id==order.config_id[0]">
<t t-if="state.stages=='ready'">
<t t-if="order.order_status=='ready'">
<div class="col-lg-4 col-md-6 col-12">
<div class="card" style="">
<div class="card-header bg_green">
<div class="left">
<div class="left"
style="padding-bottom: 8px">
<div class="icon">
<svg viewBox="0 0 12 12"
fill="none"
@ -146,10 +183,31 @@
<h4 class="c_white">
Completed
</h4>
<a class="btn btn-transparent mt c_white">
<t t-esc="order.name"/>
</a>
<t t-esc="order.order_time"/>
<div style="padding: 3px 7px;"
class="container-fluid">
<ul style="display:contents"
class="c_white">
<li>
<b>
<span style="font-size: 13px;">
<t t-esc="order.name"/>
</span>
</b>
</li>
<li>
<b>
<span style="font-size: 12px;">
Time
</span>
</b>
<span style="font-size: 12px;">
<t t-esc="order.order_time"/>
</span>
</li>
</ul>
</div>
</div>
</div>
<div class="right">
@ -162,9 +220,11 @@
</div>
<t t-if="order.order_status=='ready'">
<t t-foreach="order.lines"
t-as="lines">
<t t-foreach="widget.lines"
t-as="line">
t-as="lines"
t-key="lines">
<t t-foreach="state.lines"
t-as="line"
t-key="line.id">
<t t-if="lines==line.id">
<ul class="list-group list-group-flush">
@ -177,11 +237,11 @@
<t t-esc="line.full_product_name"/>
<br/>
<t t-if="line.note">
<i class="fa fa-tag"
<i class="fa fa-tag fa-lg"
role="img"
aria-label="Note"
title="Note"/>
<t t-esc="line.note"/>
<span style="font-size:14px"><t t-esc="line.note"/></span>
</t>
</button>
</ul>
@ -190,6 +250,7 @@
<div class="col-12 py-3">
<button type="button"
class="accept_order_line btn btn-primary"
t-on-click="(e) => this.accept_order_line(e)"
t-attf-id="lines_id_{{line.id}}"
t-att-value="line.id">
Ready
@ -200,17 +261,17 @@
</t>
</t>
</t>
</div>
</div>
</t>
</t>
<t t-elif="widget.stages=='waiting'">
<t t-elif="state.stages=='waiting'">
<t t-if="order.order_status=='waiting'">
<div class="col-lg-4 col-md-6 col-12">
<div class="card" style="">
<div class="card-header bg_blue">
<div class="left">
<div class="left"
style="padding-bottom: 8px">
<div class="icon">
<svg viewBox="0 0 15 15"
fill="none"
@ -247,10 +308,30 @@
<h4 class="c_blue">
Ready
</h4>
<a class="btn btn-transparent mt c_blue">
<t t-esc="order.name"/>
</a>
<t t-esc="order.order_time"/>
<div style="padding: 3px 7px;"
class="container-fluid">
<ul style="display:contents"
class="c_blue">
<li>
<b>
<span style="font-size: 13px;">
<t t-esc="order.name"/>
</span>
</b>
</li>
<li>
<b>
<span style="font-size: 12px;">
Time
</span>
</b>
<span style="font-size: 12px;">
<t t-esc="order.order_time"/>
</span>
</li>
</ul>
</div>
</div>
</div>
<div class="right">
@ -265,23 +346,30 @@
<button class="btn accept_order btn-primary"
t-attf-id="order_id_{{order.id}}"
t-att-value="order.id"
type="button">Accept
t-on-click="(e) => this.accept_order(e)"
type="button">
Accept
</button>
<button class="btn cancel_order btn-primary"
t-on-click="(e) => this.cancel_order(e)"
t-attf-id="cancel_order_id_{{order.id}}"
t-att-value="order.id"
type="button">Cancel
type="button">
Cancel
</button>
</t>
<t t-if="order.order_status=='waiting'">
<t t-foreach="order.lines"
t-as="lines">
<t t-foreach="widget.lines"
t-as="line">
t-as="lines"
t-key="lines">
<t t-foreach="state.lines"
t-as="line"
t-key="line.id">
<t t-if="lines==line.id">
<ul class="list-group list-group-flush">
<t t-if="order.order_status=='waiting' and line.order_status!='ready'">
<button class="list-group-item accept_order_line "
t-on-click="(e) => this.accept_order_line(e)"
t-attf-id="lines_id_{{line.id}}"
t-att-value="line.id">
@ -292,16 +380,17 @@
<t t-esc="line.full_product_name"/>
<br/>
<t t-if="line.note">
<i class="fa fa-tag"
<i class="fa fa-tag fa-lg"
role="img"
aria-label="Note"
title="Note"/>
<t t-esc="line.note"/>
<span style="font-size:14px"><t t-esc="line.note"/></span>
</t>
</button>
</t>
<t t-elif="order.order_status=='waiting' and line.order_status=='ready'">
<button class="list-group-item accept_order_line "
t-on-click="(e) => this.accept_order_line(e)"
style="text-decoration: line-through !important;color: #bfbfbf !important;"
t-attf-id="lines_id_{{line.id}}"
t-att-value="line.id">
@ -313,11 +402,11 @@
<t t-esc="line.full_product_name"/>
<br/>
<t t-if="line.note">
<i class="fa fa-tag"
<i class="fa fa-tag fa-lg"
role="img"
aria-label="Note"
title="Note"/>
<t t-esc="line.note"/>
<span style="font-size:14px"><t t-esc="line.note"/></span>
</t>
</button>
@ -331,22 +420,23 @@
<div class="card-bottom">
<button class="btn done_order btn-primary"
t-attf-id="done_order_id_{{order.id}}"
t-on-click="(e) => this.done_order(e)"
t-att-value="order.id"
type="button">Done
</button>
</div>
</div>
</div>
</t>
</t>
<t t-elif="widget.stages=='draft'">
<t t-elif="state.stages=='draft'">
<t t-if="order.order_status=='draft'">
<div id="s1"
class="col-lg-4 col-md-6 col-12">
<div class="card">
<div class="card-header bg_grey">
<div class="left">
<div class="left"
style="padding-bottom: 8px">
<div class="icon">
<svg
viewBox="0 0 10 12"
@ -361,10 +451,28 @@
<h4>
Cooking
</h4>
<a class="btn btn-transparent mt">
<t t-esc="order.name"/>
</a>
<t t-esc="order.order_time"/>
<div style="padding: 3px 7px;"
class="container-fluid">
<ul style="display:contents">
<li>
<b>
<span style="font-size: 13px;">
<t t-esc="order.name"/>
</span>
</b>
</li>
<li>
<b>
<span style="font-size: 12px;">
Time
</span>
</b>
<span style="font-size: 12px;">
<t t-esc="order.order_time"/>
</span>
</li>
</ul>
</div>
</div>
</div>
<div class="right">
@ -374,13 +482,14 @@
<img src="pos_kitchen_screen_odoo/static/src/assets/icons/Vector5.svg"
alt=""/>
</div>
</div>
<ul class="list-group list-group-flush">
<t t-foreach="order.lines"
t-as="lines">
<t t-foreach="widget.lines"
t-as="line">
t-as="lines"
t-key="lines">
<t t-foreach="state.lines"
t-as="line"
t-key="line.id">
<t t-if="lines==line.id">
<button class="list-group-item">
<span>
@ -391,11 +500,11 @@
<t t-esc="line.full_product_name"/>
<br/>
<t t-if="line.note">
<i class="fa fa-tag"
<i class="fa fa-tag fa-lg"
role="img"
aria-label="Note"
title="Note"/>
<t t-esc="line.note"/>
<span style="font-size:14px"><t t-esc="line.note"/></span>
</t>
</button>
@ -403,17 +512,17 @@
</t>
</t>
</ul>
<t t-if="order.order_status=='draft'">
<div class="accept_cancel">
<button class="btn accept_order btn-primary"
t-attf-id="order_id_{{order.id}}"
t-att-value="order.id"
t-on-click="(e) => this.accept_order(e)"
type="button">
Accept
</button>
<button class="btn cancel_order btn-secondary"
t-on-click="(e) => this.cancel_order(e)"
t-attf-id="cancel_order_id_{{order.id}}"
t-att-value="order.id"
type="button">
@ -431,7 +540,8 @@
class="col-lg-4 col-md-6 col-12">
<div class="card">
<div class="card-header bg_grey">
<div class="left">
<div class="left"
style="padding-bottom: 8px">
<div class="icon">
<svg
viewBox="0 0 10 12"
@ -449,7 +559,16 @@
<a class="btn btn-transparent mt">
<t t-esc="order.name"/>
</a>
<t t-esc="order.order_time"/>
<a class="btn btn-transparent mt "
style="margin-top: 20px;margin-left: -64px;">
<span style="font-size: 12px;">
Time
</span>
<span style="font-size: 12px;margin-left: 5px;">
<t t-esc="order.order_time"/>
</span>
</a>
</div>
</div>
<div class="right">
@ -459,13 +578,14 @@
<img src="pos_kitchen_screen_odoo/static/src/assets/icons/Vector5.svg"
alt=""/>
</div>
</div>
<ul class="list-group list-group-flush">
<t t-foreach="order.lines"
t-as="lines">
<t t-foreach="widget.lines"
t-as="line">
t-as="lines"
t-key="lines">
<t t-foreach="state.lines"
t-as="line"
t-key="line.id">
<t t-if="lines==line.id">
<button class="list-group-item">
<span>
@ -476,28 +596,28 @@
<t t-esc="line.full_product_name"/>
<br/>
<t t-if="line.note">
<i class="fa fa-tag"
<i class="fa fa-tag fa-lg"
role="img"
aria-label="Note"
title="Note"/>
<t t-esc="line.note"/>
<span style="font-size:14px"><t t-esc="line.note"/></span>
</t>
</button>
</t>
</t>
</t>
</ul>
<t t-if="order.order_status=='draft'">
<div class="accept_cancel">
<button class="btn accept_order btn-primary"
t-attf-id="order_id_{{order.id}}"
t-att-value="order.id"
t-on-click="(e) => this.accept_order(e)"
type="button">
Accept
</button>
<button class="btn cancel_order btn-secondary"
t-on-click="(e) => this.cancel_order(e)"
t-attf-id="cancel_order_id_{{order.id}}"
t-att-value="order.id"
type="button">
@ -516,4 +636,4 @@
</div>
</section>
</t>
</template>
</template>

2
pos_kitchen_screen_odoo/views/kitchen_screen_views.xml

@ -65,7 +65,7 @@
<field name="shop_number" invisible="1"/>
<button name="%(kitchen_custom_dashboard_action)d"
type="action"
context="{'default_lead_id': shop_number}"
context="{'default_shop_id': shop_number}"
string="Kitchen Screen"
target="new"
class="btn-primary kitchen_screen1"

Loading…
Cancel
Save