
Module
account_reconcile_oca
Describe the bug
[Problem:]
Given I click through the items in Bank Reconcile (Accounting > Reconcile)
When I keep clicking through the items on the list
Then I see Odoo Client Error Uncaught Promise > Cannot read properties of null (reading 'isDirty')
But it does NOT happen, when clicking thru the items slowly
To Reproduce
Affected versions:
getting the error on version 16.0.2.1.2 of the account_reconcile_oca addon
Steps to reproduce the behavior:
- Populate the account.reconcile menu. (or another that is affected by the reconcile_controller.esm.js)
- Rapidly click through the records in the menu (record panel on the left side)
- Error message Uncaught Promise > Cannot read properties of null (reading 'isDirty') will pop up
Expected behavior
The error pops up because the records are being loaded slower that the user clicks through them.
SO the expected behavior is simply no error message pop up when the records are being loaded normally.
I have found the solution myself and would like to suggest it here:
- Navigate to
account_reconcile_oca\static\src\js\reconcile\reconcile_controller.esm.js
- Find the function
async selectRecord(record)
- in the
async selectRecord(record) function find the following code block:
if (this.state.selectedRecordId && this.state.selectedRecordId !== resId) {
if (this.form_controller && this.form_controller.model.root.isDirty) {
await this.form_controller.model.root.save({
noReload: true,
stayInEdition: true,
useSaveErrorDialog: true,
});
await this.model.root.load();
await this.render(true);
}
}
- Add an additional check to the
if (this.form_controller && this.form_controller.model.root.isDirty) { line, like this:
if (this.form_controller && this.form_controller.model.root && this.form_controller.model.root.isDirty) {
- This prevents the error pop up in the UI.
Thank you for your attention!
Module
account_reconcile_oca
Describe the bug
[Problem:]
Given I click through the items in Bank Reconcile (Accounting > Reconcile)
When I keep clicking through the items on the list
Then I see Odoo Client Error Uncaught Promise > Cannot read properties of null (reading 'isDirty')
But it does NOT happen, when clicking thru the items slowly
To Reproduce
Affected versions:
getting the error on version 16.0.2.1.2 of the account_reconcile_oca addon
Steps to reproduce the behavior:
Expected behavior
The error pops up because the records are being loaded slower that the user clicks through them.
SO the expected behavior is simply no error message pop up when the records are being loaded normally.
I have found the solution myself and would like to suggest it here:
account_reconcile_oca\static\src\js\reconcile\reconcile_controller.esm.jsasync selectRecord(record)async selectRecord(record)function find the following code block:if (this.form_controller && this.form_controller.model.root.isDirty) {line, like this:if (this.form_controller && this.form_controller.model.root && this.form_controller.model.root.isDirty) {Thank you for your attention!