From 456f634b94a7ff17ff92c22ce90a3b0f0ec79dbe Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 8 Apr 2016 14:20:13 +0200 Subject: [PATCH] [IMP] sale: use fields.Datetime.now instead of datetime.now Better because it correctly uses format / tz / ... --- addons/sale/sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index ef894e88a15..111cd769843 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -108,7 +108,7 @@ class SaleOrder(models.Model): validity_date = fields.Date(string='Expiration Date', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Manually set the expiration date of your quotation (offer), or it will set the date automatically based on the template if online quotation is installed.") create_date = fields.Datetime(string='Creation Date', readonly=True, index=True, help="Date on which sales order is created.") - confirmation_date = fields.Datetime(string='Confirmation Date', readonly=True, index=True, help="Date on which the sale order is created.") + confirmation_date = fields.Datetime(string='Confirmation Date', readonly=True, index=True, help="Date on which the sale order is confirmed.") user_id = fields.Many2one('res.users', string='Salesperson', index=True, track_visibility='onchange', default=lambda self: self.env.user) partner_id = fields.Many2one('res.partner', string='Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, index=True, track_visibility='always') partner_invoice_id = fields.Many2one('res.partner', string='Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Invoice address for current sales order.") @@ -434,7 +434,7 @@ class SaleOrder(models.Model): def action_confirm(self): for order in self: order.state = 'sale' - order.confirmation_date = datetime.now() + order.confirmation_date = fields.Datetime.now() if self.env.context.get('send_email'): self.force_quotation_send() order.order_line._action_procurement_create()