22// Copyright 2025 Quartile (https://www.quartile.co)
33// License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
44
5- import { patch } from "@web/core/utils/patch" ;
65import { onMounted , onWillUnmount } from "@odoo/owl" ;
76import { FormController } from "@web/views/form/form_controller" ;
87import { Record } from "@web/model/relational_model/record" ;
8+ import { patch } from "@web/core/utils/patch" ;
99
1010const recRoot = ( c ) => ( c && c . model && c . model . root ) || null ;
1111const childSpan = ( el ) => {
1212 try {
1313 return ( el && el . querySelector ( ":scope > span" ) ) || null ;
14- } catch { }
14+ } catch {
15+ // Ignore
16+ }
1517 const f = el && el . firstElementChild ;
1618 return f && f . tagName === "SPAN" ? f : null ;
1719} ;
@@ -22,10 +24,13 @@ const setHtml = (el, html) => {
2224const safe = async ( fn , fb ) => {
2325 try {
2426 return await fn ( ) ;
25- } catch { }
27+ } catch {
28+ // Ignore
29+ }
2630 return fb ;
2731} ;
2832
33+ /* eslint-disable no-inline-comments */
2934function normalizeValue ( v ) {
3035 if ( v === null || v === undefined ) return v ; // Null/undefined
3136 const t = typeof v ;
@@ -77,7 +82,7 @@ async function refreshBanners(ctrl, extraChanges) {
7782 if ( ! nodes . length ) return ;
7883 const snap = { ...shrink ( rec . data ) , ...shrink ( extraChanges ) } ;
7984 const names = triggerNames ( ctrl ) ;
80- const vals = ! rec . resId ? snap : names . length ? sliceBy ( snap , names ) : { } ;
85+ const vals = rec . resId ? ( names . length ? sliceBy ( snap , names ) : { } ) : snap ;
8186 const orm = ctrl . env . services . orm ;
8287 for ( const el of nodes ) {
8388 const ruleId = parseInt ( el . dataset . ruleId , 10 ) ;
@@ -98,7 +103,10 @@ async function refreshBanners(ctrl, extraChanges) {
98103function scheduleRefresh ( ctrl ) {
99104 if ( ctrl . __wfbSched ) return ;
100105 ctrl . __wfbSched = true ;
101- requestAnimationFrame ( ( ) => ( ( ctrl . __wfbSched = false ) , refreshBanners ( ctrl ) ) ) ;
106+ requestAnimationFrame ( ( ) => {
107+ ctrl . __wfbSched = false ;
108+ refreshBanners ( ctrl ) ;
109+ } ) ;
102110}
103111
104112function tick ( ctrl ) {
@@ -164,7 +172,9 @@ patch(Record.prototype, {
164172 const ctrl = this . model . __controller ;
165173 if ( ctrl ) tick ( ctrl ) ;
166174 }
167- } catch { }
175+ } catch {
176+ // Ignore
177+ }
168178 return res ;
169179 } ,
170180} ) ;
0 commit comments