From 36026bc7719eda42eabc9f3aa3711b56b0e22f09 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 4 Aug 2016 12:56:17 +0200 Subject: [PATCH] [FIX] hr_payroll_account: wrong date The date account is always the date of the day. This is not correct according to the field description. Fixes #12832 Closes #12833 opw-683969 --- addons/hr_payroll_account/hr_payroll_account.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index fa07751f290..c27df320165 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -1,7 +1,5 @@ #-*- coding:utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -import time -from datetime import date, datetime, timedelta from openerp import api from openerp.osv import fields, osv @@ -94,13 +92,12 @@ class hr_payslip(osv.osv): move_pool = self.pool.get('account.move') hr_payslip_line_pool = self.pool['hr.payslip.line'] precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Payroll') - timenow = time.strftime('%Y-%m-%d') for slip in self.browse(cr, uid, ids, context=context): line_ids = [] debit_sum = 0.0 credit_sum = 0.0 - date = timenow + date = slip.date or slip.date_to name = _('Payslip of %s') % (slip.employee_id.name) move = { @@ -152,7 +149,6 @@ class hr_payslip(osv.osv): raise UserError(_('The Expense Journal "%s" has not properly configured the Credit Account!') % (slip.journal_id.name)) adjust_credit = (0, 0, { 'name': _('Adjustment Entry'), - 'date': timenow, 'partner_id': False, 'account_id': acc_id, 'journal_id': slip.journal_id.id,