Skip to content

Commit a9e5a0c

Browse files
add defer exection
1 parent b4d783b commit a9e5a0c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

web_form_banner/static/description/index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -603,7 +604,9 @@ <h2><a class="toc-backref" href="#toc-entry-12">Contributors</a></h2>
603604
<div class="section" id="maintainers">
604605
<h2><a class="toc-backref" href="#toc-entry-13">Maintainers</a></h2>
605606
<p>This module is maintained by the OCA.</p>
606-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
607+
<a class="reference external image-reference" href="https://odoo-community.org">
608+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
609+
</a>
607610
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
608611
mission is to support the collaborative development of Odoo features and
609612
promote its widespread use.</p>

web_form_banner/static/src/js/web_form_banner.esm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ async function refreshBanners(ctrl, extraChanges) {
105105
const st = ctrl.model && ctrl.handle ? ctrl.model.get(ctrl.handle) : null;
106106
const resId = st && st.res_id;
107107
const base = shrinkDraft(st && st.data) || {};
108+
const tset = triggerSet(ctrl);
108109
const latest = shrinkDraft(extraChanges || {});
109110
const snap = Object.assign({}, base, latest);
110-
const tset = triggerSet(ctrl);
111111
const hasTriggers = Object.keys(tset).length > 0;
112112
const formVals = resId ? (hasTriggers ? pickKeys(snap, tset) : {}) : snap;
113113

@@ -182,7 +182,8 @@ FormController.include({
182182
const changed = (ev && ev.data && ev.data.changes) || {};
183183
const names = Object.keys(changed);
184184
if (!names.some((n) => tset[n])) return res;
185-
after(res, () => refreshBanners(this, changed));
185+
// Defer one tick so x2many widgets commit their in-memory value first
186+
after(res, () => setTimeout(() => refreshBanners(this, changed), 0));
186187
return res;
187188
},
188189
activate: function () {

0 commit comments

Comments
 (0)