[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) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
pedrambiria
2023-03-14 12:24:09 +01:00
parent 8d40bcf89a
commit 3faef68a58
+1 -1
View File
@@ -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,