[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
This commit is contained in:
Jared Kipe
2016-08-04 12:56:26 +02:00
committed by Nicolas Martinelli
parent 566e0a2706
commit 36026bc771
@@ -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,