clean up code

This commit is contained in:
suherdy.yacob@mapan.co.id 2025-04-08 10:02:16 +07:00
parent 8f94a48948
commit 4e132fad16
3 changed files with 6 additions and 13 deletions

View File

@ -9,22 +9,14 @@ class CustomPosOrder(models.Model):
for order in self:
pos_config = self.env['pos.config']
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:
#self.env['pos_preparation_display.display']._send_load_orders_message()
self.env['bus.bus']._sendone(f'preparation_display-{display.access_token}', 'load_orders', {
'preparation_display_id': display.id,
'sound': True
})
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
return res

View File

@ -5,6 +5,7 @@ import { useService } from "@web/core/utils/hooks";
import { PreparationDisplay } from "@pos_preparation_display/app/models/preparation_display";
patch(PreparationDisplay.prototype, {
//override the setup of preparation display
async setup(data, env, preparationDisplayId) {
this.id = preparationDisplayId;
this.env = env;
@ -39,7 +40,6 @@ patch(PreparationDisplay.prototype, {
// force refresh every 5 seconds
// setTimeout(function(){
// window.location.reload();
// }, 5000);

View File

@ -5,6 +5,7 @@
<div class="o_pdis_table pe-1">
<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>
<!-- change the self order tracking number, default is 'IN'-->
<t t-else="">
T<t t-if="this.props.order.table.name" t-esc="this.props.order.table.name"/> </t>
</t>