[IMP] account: Allow locking the period with cancelled statement lines
This case shouldn't appear in a normal usage of the statement lines because there is no way to cancel them. However, this case should be supported in 14.0 due to a choice we made for the migration. Indeed, we don't want to create draft journal entries in a locked period during the migration but the statement lines that are not reconciled in a locked period shouldn't be deleted in order to keep the statement starting/ending balance consistency. So, the journal entries created in a locked period for not reconciled statement lines are cancelled and then, we don't want to block the locking of any period because of that. closes odoo/odoo#63104 X-original-commit: b5e186124de69061e91f657e1a330ba019614256 Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
@@ -229,6 +229,7 @@ class ResCompany(models.Model):
|
||||
('company_id', 'in', self.ids),
|
||||
('is_reconciled', '=', False),
|
||||
('date', '<=', values['fiscalyear_lock_date']),
|
||||
('move_id.state', 'in', ('draft', 'posted')),
|
||||
])
|
||||
if unreconciled_statement_lines:
|
||||
error_msg = _("There are still unreconciled bank statement lines in the period you want to lock."
|
||||
|
||||
Reference in New Issue
Block a user