From 3faef68a58a745ab734e34b49fac760a76259e22 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Thu, 2 Mar 2023 10:49:21 +0000 Subject: [PATCH] [FIX] point_of_sale: send `creation_date` with its time offset Before this commit: in the PoS restaurant paid orders' date will be shown wrong. The problem is that it will be sent based on the user's timezone, and `init_from_json` in PoS restaurant converts it again to the local time. The solution is to send the time with its offset. Converting the time to string will keeo the time offset in the format. opw-3195027 closes odoo/odoo#115128 X-original-commit: 882dab5fdba32bb51ac4efbc3f0d4e684203a622 Signed-off-by: Trinh Jacky (trj) Signed-off-by: Pedram Bi Ria (pebr) --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 7a662a7d722..061e381438e 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -1228,7 +1228,7 @@ class PosOrder(models.Model): 'partner_id': order.partner_id.id, 'user_id': order.user_id.id, 'sequence_number': order.sequence_number, - 'creation_date': order.date_order.astimezone(timezone), + 'creation_date': str(order.date_order.astimezone(timezone)), 'fiscal_position_id': order.fiscal_position_id.id, 'to_invoice': order.to_invoice, 'shipping_date': order.shipping_date,