[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
This commit is contained in:
Denis Ledoux
2015-10-30 16:24:50 +01:00
parent 6dfcc5f9c8
commit fba855a717
+1 -1
View File
@@ -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')