mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[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:
parent
075e6a99b0
commit
749382a1e7
@ -30,7 +30,6 @@
|
|||||||
],
|
],
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
'runbot_merge/static/scss/runbot_merge_backend.scss',
|
'runbot_merge/static/scss/runbot_merge_backend.scss',
|
||||||
'runbot_merge/static/src/project_freeze/index.js',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'post_load': 'enable_sentry',
|
'post_load': 'enable_sentry',
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<field name="name">Freeze Wizard Configuration Screen</field>
|
<field name="name">Freeze Wizard Configuration Screen</field>
|
||||||
<field name="model">runbot_merge.project.freeze</field>
|
<field name="model">runbot_merge.project.freeze</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form js_class="freeze_wizard">
|
<form>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="alert alert-warning" role="alert"
|
<div class="alert alert-warning" role="alert"
|
||||||
invisible="not errors">
|
invisible="not errors">
|
||||||
|
@ -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,
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user