From 01c64f3907b5b82f5e9d9ef3e17441971ac67df4 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Fri, 8 May 2020 09:14:55 +0000 Subject: [PATCH] [FIX] point_of_sale: wrong date in pos payment - Have a user in an early timezone (for example Samoa Standard Time); - Open a POS session in the evening (say 20h). - Buy something and pay with cash. - Close the session. - List the session orders, and open the newly create order. Before this commit, the date of the order was correct (today at 20h), but the date of the payment was wrong (yesterday at 13h). This error occurs because a wrong format was used and the date was taken into account two times the timezone. Now, both dates are corrected. This fix is a partial revert of 2157540768112107a3c68ed28ce429572e28fce5 opw-2231820 X-original-commit: 020e5547ad10583000748659de0e2b14ceabbf97 --- addons/point_of_sale/models/pos_order.py | 4 +--- addons/point_of_sale/views/pos_payment_views.xml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index e59b5e0fd25..74cf28f310a 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -53,11 +53,9 @@ class PosOrder(models.Model): @api.model def _payment_fields(self, order, ui_paymentline): - payment_date = ui_paymentline['name'] - payment_date = fields.Date.context_today(self, fields.Datetime.from_string(payment_date)) return { 'amount': ui_paymentline['amount'] or 0.0, - 'payment_date': payment_date, + 'payment_date': ui_paymentline['name'], 'payment_method_id': ui_paymentline['payment_method_id'], 'card_type': ui_paymentline.get('card_type'), 'transaction_id': ui_paymentline.get('transaction_id'), diff --git a/addons/point_of_sale/views/pos_payment_views.xml b/addons/point_of_sale/views/pos_payment_views.xml index 06a40b6389e..4093605f5c3 100644 --- a/addons/point_of_sale/views/pos_payment_views.xml +++ b/addons/point_of_sale/views/pos_payment_views.xml @@ -27,7 +27,7 @@ - +