From 0606306dd2141501b2dc9be1fcb25b68aeda0a59 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 6 Dec 2011 11:50:21 +0100 Subject: [PATCH] [FIX] incorrect date format output in hr.timesheet.analytic.profit default value lp bug: https://launchpad.net/bugs/900647 fixed bzr revid: xmo@openerp.com-20111206105021-pr9miyu518ayohj0 --- .../wizard/hr_timesheet_analytic_profit.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py index 7d5d7a36867..518bb981df9 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py @@ -31,18 +31,18 @@ class account_analytic_profit(osv.osv_memory): 'date_to': fields.date('To', required=True), 'journal_ids': fields.many2many('account.analytic.journal', 'analytic_profit_journal_rel', 'analytic_id', 'journal_id', 'Journal', required=True), 'employee_ids': fields.many2many('res.users', 'analytic_profit_emp_rel', 'analytic_id', 'emp_id', 'User', required=True), - } + } def _date_from(*a): - return datetime.datetime.today().strftime('%Y-%m-1') + return datetime.date.today().replace(day=1).strftime('%Y-%m-%d') def _date_to(*a): - return datetime.datetime.today().strftime('%Y-%m-%d') + return datetime.date.today().strftime('%Y-%m-%d') _defaults = { - 'date_from': _date_from, - 'date_to': _date_to - } + 'date_from': _date_from, + 'date_to': _date_to + } def print_report(self, cr, uid, ids, context=None): line_obj = self.pool.get('account.analytic.line') @@ -72,4 +72,4 @@ class account_analytic_profit(osv.osv_memory): account_analytic_profit() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: