clean up code
This commit is contained in:
parent
8f94a48948
commit
4e132fad16
@ -9,22 +9,14 @@ class CustomPosOrder(models.Model):
|
|||||||
for order in self:
|
for order in self:
|
||||||
pos_config = self.env['pos.config']
|
pos_config = self.env['pos.config']
|
||||||
displays = self.env['pos_preparation_display.display'].search([])
|
displays = self.env['pos_preparation_display.display'].search([])
|
||||||
# displays = pos_config.pos_preparation_display.display_ids
|
|
||||||
|
|
||||||
|
# refresh the display using bus.bus service (in js bus_service)
|
||||||
|
# with channel 'preparation_display-{display.access_token}'
|
||||||
|
# and message 'load_orders' with data {'preparation_display_id': display.id, 'sound': True}
|
||||||
for display in displays:
|
for display in displays:
|
||||||
#self.env['pos_preparation_display.display']._send_load_orders_message()
|
#self.env['pos_preparation_display.display']._send_load_orders_message()
|
||||||
self.env['bus.bus']._sendone(f'preparation_display-{display.access_token}', 'load_orders', {
|
self.env['bus.bus']._sendone(f'preparation_display-{display.access_token}', 'load_orders', {
|
||||||
'preparation_display_id': display.id,
|
'preparation_display_id': display.id,
|
||||||
'sound': True
|
'sound': True
|
||||||
})
|
})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
# def _process_saved_order(self, draft):
|
|
||||||
# self.ensure_one()
|
|
||||||
# order_id = super()._process_saved_order(draft)
|
|
||||||
# self.send_table_count_notification(self.table_id)
|
|
||||||
# self.env['bus.bus']._sendone(f'preparation_display-{self.access_token}', 'load_orders', {
|
|
||||||
# 'preparation_display_id': self.id,
|
|
||||||
# 'sound': True
|
|
||||||
# })
|
|
||||||
# return order_id
|
|
||||||
@ -5,6 +5,7 @@ import { useService } from "@web/core/utils/hooks";
|
|||||||
import { PreparationDisplay } from "@pos_preparation_display/app/models/preparation_display";
|
import { PreparationDisplay } from "@pos_preparation_display/app/models/preparation_display";
|
||||||
|
|
||||||
patch(PreparationDisplay.prototype, {
|
patch(PreparationDisplay.prototype, {
|
||||||
|
//override the setup of preparation display
|
||||||
async setup(data, env, preparationDisplayId) {
|
async setup(data, env, preparationDisplayId) {
|
||||||
this.id = preparationDisplayId;
|
this.id = preparationDisplayId;
|
||||||
this.env = env;
|
this.env = env;
|
||||||
@ -39,7 +40,6 @@ patch(PreparationDisplay.prototype, {
|
|||||||
|
|
||||||
// force refresh every 5 seconds
|
// force refresh every 5 seconds
|
||||||
|
|
||||||
|
|
||||||
// setTimeout(function(){
|
// setTimeout(function(){
|
||||||
// window.location.reload();
|
// window.location.reload();
|
||||||
// }, 5000);
|
// }, 5000);
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
<div class="o_pdis_table pe-1">
|
<div class="o_pdis_table pe-1">
|
||||||
<t t-if="this.props.order.take_away">OUT </t>
|
<t t-if="this.props.order.take_away">OUT </t>
|
||||||
<t t-elif="this.props.order.table_stand_number or (this.props.order.table and this.props.order.table.name)">T<t t-if="this.props.order.table_stand_number" t-esc="this.props.order.table_stand_number"/><t t-else="" t-esc="this.props.order.table.name"/> </t>
|
<t t-elif="this.props.order.table_stand_number or (this.props.order.table and this.props.order.table.name)">T<t t-if="this.props.order.table_stand_number" t-esc="this.props.order.table_stand_number"/><t t-else="" t-esc="this.props.order.table.name"/> </t>
|
||||||
|
<!-- change the self order tracking number, default is 'IN'-->
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
T<t t-if="this.props.order.table.name" t-esc="this.props.order.table.name"/> </t>
|
T<t t-if="this.props.order.table.name" t-esc="this.props.order.table.name"/> </t>
|
||||||
</t>
|
</t>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user