From d3bf03ff791d9b08b4315a266a410d336d8f3af2 Mon Sep 17 00:00:00 2001 From: guva-odoo Date: Tue, 21 Nov 2023 10:18:55 +0100 Subject: [PATCH] [FIX] account: delete bank statement Manual fw port of https://github.com/odoo/odoo/pull/130914 When trying to delete a bank statement, if there is no move with the same id, we get an error "Record doesn't exist or has been deleted". The reason is we call the account_move.check_move_sequence_chain() method wih the id of the statement. We avoid using account_move_service if the model is not account_move as it make no sense to call an account_move method from a bank statement record. Root cause: https://github.com/odoo/enterprise/blob/fd6586e8b098f018a54c715c53a2c12fe192bf7c/account_bank_statement_import/views/account_bank_statement_import_view.xml#L28 opw-3425826 closes odoo/odoo#142818 Signed-off-by: Habib Ayob (ayh) --- .../account/static/src/components/bills_upload/bills_upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/static/src/components/bills_upload/bills_upload.js b/addons/account/static/src/components/bills_upload/bills_upload.js index 97449736ea6..91ede12ef89 100644 --- a/addons/account/static/src/components/bills_upload/bills_upload.js +++ b/addons/account/static/src/components/bills_upload/bills_upload.js @@ -143,7 +143,7 @@ export class AccountMoveListController extends ListController { async onDeleteSelectedRecords() { const selectedResIds = await this.getSelectedResIds(); - if (!await this.account_move_service.addDeletionDialog(this, selectedResIds)) { + if (this.props.resModel !== "account.move" || !await this.account_move_service.addDeletionDialog(this, selectedResIds)) { return super.onDeleteSelectedRecords(...arguments); } }