diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py
index 687519d2457..69f4bd706c2 100644
--- a/addons/point_of_sale/report/pos_receipt.py
+++ b/addons/point_of_sale/report/pos_receipt.py
@@ -22,6 +22,7 @@
import time
from report import report_sxw
+from mx.DateTime.ISO import ParseAny
import pooler
@@ -35,11 +36,17 @@ class order(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
+ 'dformat': '%Y/%m/%d %H:%M:%S',
'disc': self.discount,
'net': self.netamount,
+ 'formatdate': self.formatdate,
'address': partner.address and partner.address[0] or False,
})
+ def formatdate(self, datestr):
+ dateobj = ParseAny(datestr)
+ return dateobj.strftime(self.localcontext['dformat'])
+
def netamount(self, order_line_id):
sql = 'select (qty*price_unit) as net_price from pos_order_line where id = %s'
self.cr.execute(sql, (order_line_id,))
diff --git a/addons/point_of_sale/report/pos_receipt.rml b/addons/point_of_sale/report/pos_receipt.rml
index 75b5ce3f01e..067d775db2f 100644
--- a/addons/point_of_sale/report/pos_receipt.rml
+++ b/addons/point_of_sale/report/pos_receipt.rml
@@ -83,8 +83,8 @@
Tel : [[ address and address.phone ]]
E-mail : [[ address and address.email ]]
Salesman : [[ o.salesman_id.name ]]
- Sale Date : [[ o.date_order ]]
- Receipt Printing Date : [[ time.strftime('%d/%m/%Y %H:%M') ]]
+ Sale Date : [[ formatdate(o.date_order) ]]
+ Receipt Printing Date : [[ time.strftime(dformat) ]]