[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) <nim@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2019-11-28 12:04:21 +00:00
parent 1b3b7a61a6
commit 72386a4832
+1 -1
View File
@@ -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],
}