From 72386a4832db2568aad2843db7ecee2abae30d04 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Thu, 28 Nov 2019 12:04:21 +0000 Subject: [PATCH] [FIX] point_of_sale: respect order date when issuing invoice Create a sale order in POS with generate invoice option enabled. When the user timezone is creating a day difference with respect to UTC the date reported on the invoice will be wrong. This is caused by the invoice date being written using `fields.Date.today()` , which is using the UTC date. Respecting the order_date fix the issue opw-2129440 closes odoo/odoo#41121 X-original-commit: 34fcb7300a8eb73b39f5f871e3553f036d6f3639 Signed-off-by: Nicolas Martinelli (nim) --- 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 81399d6d431..c558da249ba 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -386,7 +386,7 @@ class PosOrder(models.Model): # considering partner's sale pricelist's currency 'currency_id': order.pricelist_id.currency_id.id, 'invoice_user_id': order.user_id.id, - 'invoice_date': fields.Date.today(), + 'invoice_date': order.date_order.date(), 'fiscal_position_id': order.fiscal_position_id.id, 'invoice_line_ids': [(0, None, order._prepare_invoice_line(line)) for line in order.lines], }