[FIX] account: cash basis entry date
Create an invoice in date1 with a tax due based on payment (cash basis) Create a credit note in date2 for the invoice (with date2 > date1) Set tax lock date in date3 (with today > date3 > date2 > date1) In the invoice add the credit note as payment The system will block the action, because the created cash basis entry would use as date the most recent between invoice and credit note, which is previous to the lock date. opw-2730106 closes odoo/odoo#98425 X-original-commit: 087e967f6ebf6e5829ec1d72a672841f8d543d4a Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -383,6 +383,7 @@ class AccountPartialReconcile(models.Model):
|
||||
:return: The newly created journal entries.
|
||||
'''
|
||||
tax_cash_basis_values_per_move = self._collect_tax_cash_basis_values()
|
||||
today = fields.Date.context_today(self)
|
||||
|
||||
moves_to_create = []
|
||||
to_reconcile_after = []
|
||||
@@ -394,9 +395,10 @@ class AccountPartialReconcile(models.Model):
|
||||
partial = partial_values['partial']
|
||||
|
||||
# Init the journal entry.
|
||||
move_date = partial.max_date if partial.max_date > (move.company_id.period_lock_date or date.min) else today
|
||||
move_vals = {
|
||||
'move_type': 'entry',
|
||||
'date': partial.max_date,
|
||||
'date': move_date,
|
||||
'ref': move.name,
|
||||
'journal_id': partial.company_id.tax_cash_basis_journal_id.id,
|
||||
'line_ids': [],
|
||||
|
||||
Reference in New Issue
Block a user