From fba855a7173137346aa67809743ee82a85327dca Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 30 Oct 2015 16:21:54 +0100 Subject: [PATCH] [FIX] purchase: Order date default value. Using `fields.Date.context_today` for a `Date` field is the right thing to do, but not for a `Datetime` field, as it won't return the current hour, and this will lead to issues with the different possible timezones. opw-652391 --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 0bcfca34b0f..5143adad780 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -102,7 +102,7 @@ class PurchaseOrder(models.Model): "It's used to do the matching when you receive the " "products as this reference is usually written on the " "delivery order sent by your vendor.") - date_order = fields.Datetime('Order Date', required=True, states=READONLY_STATES, select=True, copy=False, default=fields.Date.context_today,\ + date_order = fields.Datetime('Order Date', required=True, states=READONLY_STATES, select=True, copy=False, default=fields.Datetime.now(),\ help="Depicts the date where the Quotation should be validated and converted into a purchase order.") date_approve = fields.Date('Approval Date', readonly=1, select=True, copy=False) partner_id = fields.Many2one('res.partner', string='Vendor', required=True, states=READONLY_STATES, change_default=True, track_visibility='always')