[REM] runbot_merge: freeze wizard auto-refresh

Turns out to not work well in 17.0, and after consideration moc hasn't
really used the auto-update feature (or the required-prs gate in
general to be honest), usually he knows what PRs he's waiting for and
only validates once he's confirmed every which way.

So it's probably not worth fixing the thing. According to jpp, this
should probably use something based on bus subscriptions to update
just the field (though tbf the `root.update` call doesn't really seem
to be "deep" anymore, so in reality rather than update the *form*'s
record I should probably have tried reloading the required_pr_ids
records to fetch the new color).

Closes #997
This commit is contained in:
Xavier Morel 2024-11-28 13:22:32 +01:00
parent 075e6a99b0
commit 749382a1e7
3 changed files with 1 additions and 38 deletions

View File

@ -30,7 +30,6 @@
],
'web.assets_backend': [
'runbot_merge/static/scss/runbot_merge_backend.scss',
'runbot_merge/static/src/project_freeze/index.js',
],
},
'post_load': 'enable_sentry',

View File

@ -3,7 +3,7 @@
<field name="name">Freeze Wizard Configuration Screen</field>
<field name="model">runbot_merge.project.freeze</field>
<field name="arch" type="xml">
<form js_class="freeze_wizard">
<form>
<sheet>
<div class="alert alert-warning" role="alert"
invisible="not errors">

View File

@ -1,36 +0,0 @@
/** @odoo-module */
import {useEffect} from "@odoo/owl";
import {x2ManyCommands} from "@web/core/orm_service";
import {registry} from "@web/core/registry";
import {FormController} from "@web/views/form/form_controller";
import {formView} from "@web/views/form/form_view";
class FreezeController extends FormController {
setup() {
super.setup();
useEffect(() => {
const interval = setInterval(async () => {
const root = this.model.root;
if (await root.isDirty()) {
root.update({
required_pr_ids: x2ManyCommands.set(
root.data.required_pr_ids.currentIds,
),
});
} else {
root.load();
}
}, 1000);
return () => {
clearInterval(interval);
};
}, () => []);
}
}
registry.category("views").add('freeze_wizard', {
...formView,
Controller: FreezeController,
});