21 lines
914 B
Python
21 lines
914 B
Python
from odoo import api, fields, models
|
|
|
|
class CustomPosOrder(models.Model):
|
|
_inherit = 'pos.order'
|
|
|
|
def _process_saved_order(self, draft):
|
|
# Call the original logic
|
|
res = super()._process_saved_order(draft)
|
|
for order in self:
|
|
pos_config = self.env['pos.config']
|
|
displays = self.env['pos_preparation_display.display'].search([])
|
|
|
|
# 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['bus.bus']._sendone(f'preparation_display-{display.access_token}', 'load_orders', {
|
|
'preparation_display_id': display.id,
|
|
'sound': True
|
|
})
|
|
return res |