[FIX] account_reconcile_oca: Use reconcile_form widget. Remove reconcile_manual widget

pull/829/head
Enric Tobella 2025-04-13 07:00:25 +02:00
parent 8de2a3e09d
commit 872f875225
4 changed files with 1 additions and 45 deletions

View File

@ -36,7 +36,6 @@
"account_reconcile_oca/static/src/js/widgets/reconcile_move_line_widget.esm.js",
"account_reconcile_oca/static/src/js/reconcile_move_line/*.esm.js",
"account_reconcile_oca/static/src/js/reconcile_form/*.esm.js",
"account_reconcile_oca/static/src/js/reconcile_manual/*.esm.js",
"account_reconcile_oca/static/src/js/reconcile/*.esm.js",
"account_reconcile_oca/static/src/xml/reconcile.xml",
"account_reconcile_oca/static/src/scss/reconcile.scss",

View File

@ -1,33 +0,0 @@
import {FormController} from "@web/views/form/form_controller";
import {useViewButtons} from "@web/views/view_button/view_button_hook";
const {useRef} = owl;
export class ReconcileManualController extends FormController {
setup() {
super.setup(...arguments);
this.env.exposeController(this);
const rootRef = useRef("root");
useViewButtons(this.model, rootRef, {
reload: this.reloadFormController.bind(this),
beforeExecuteAction: this.beforeExecuteActionButton.bind(this),
afterExecuteAction: this.afterExecuteActionButton.bind(this),
});
}
displayName() {
return this.env.config.getDisplayName();
}
async reloadFormController() {
try {
await this.model.root.load();
} catch (error) {
// eslint-disable-next-line no-undef
console.error("Error reloading form controller:", error);
// This should happen when we reconcile a line (no more possible data...)
if (this.env.parentController) {
await this.env.parentController.model.root.load();
await this.env.parentController.render(true);
this.env.parentController.selectRecord();
}
}
}
}

View File

@ -1,10 +0,0 @@
import {ReconcileManualController} from "./reconcile_manual_controller.esm.js";
import {formView} from "@web/views/form/form_view";
import {registry} from "@web/core/registry";
export const FormManualReconcileView = {
...formView,
Controller: ReconcileManualController,
};
registry.category("views").add("reconcile_manual", FormManualReconcileView);

View File

@ -8,7 +8,7 @@
>account.account.reconcile.form (in account_reconcile_oca)</field>
<field name="model">account.account.reconcile</field>
<field name="arch" type="xml">
<form js_class="reconcile_manual" create="0">
<form js_class="reconcile_form" create="0">
<field name="manual_delete" invisible="1" />
<field name="manual_reference" invisible="1" />
<field name="company_currency_id" invisible="1" />