summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2019-11-28 12:04:21 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2019-11-28 12:04:21 +0000
commit72386a4832db2568aad2843db7ecee2abae30d04 (patch)
tree651217f58e55bed721899f41c2c58315c8f22c9d
parent1b3b7a61a6124048237a00d7fd3d385a437ebdf9 (diff)
[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>
-rw-r--r--addons/point_of_sale/models/pos_order.py2
1 files changed, 1 insertions, 1 deletions
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],
}