From 28bba0a486874c4d0b1a343884f3aa73e147ae4c Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Mon, 7 Nov 2016 11:06:30 +0100 Subject: [PATCH] [FIX] account_tax_cash_basis: fix the move date of to be one of the dates of the operations, instead of today... Was today if you recorded operations in the future (????)... but, still, it's cleaner that way --- .../models/account_partial_reconcile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account_tax_cash_basis/models/account_partial_reconcile.py b/addons/account_tax_cash_basis/models/account_partial_reconcile.py index 2c5829ab5c9..382219a8b68 100644 --- a/addons/account_tax_cash_basis/models/account_partial_reconcile.py +++ b/addons/account_tax_cash_basis/models/account_partial_reconcile.py @@ -81,10 +81,10 @@ class AccountPartialReconcileCashBasis(models.Model): 'amount_currency': self.amount_currency and line.currency_id.round(-line.amount_currency * amount / line.balance) or 0.0, }) if newly_created_move: - if move_date > self.company_id.period_lock_date and newly_created_move.date > move_date: + if move_date > self.company_id.period_lock_date and newly_created_move.date != move_date: # The move date should be the maximum date between payment and invoice (in case # of payment in advance). However, we should make sure the move date is not - # recorded after the period lock date as the tax statement for this period is + # recorded before the period lock date as the tax statement for this period is # probably already sent to the estate. newly_created_move.write({'date': move_date}) # post move @@ -98,7 +98,7 @@ class AccountPartialReconcileCashBasis(models.Model): (self.company_id.name)) move_vals = { 'journal_id': self.company_id.tax_cash_basis_journal_id.id, - 'tax_cash_basis_rec_id': self.id + 'tax_cash_basis_rec_id': self.id, } return self.env['account.move'].create(move_vals)