Skip to content

Commit 2bd9a20

Browse files
committed
[FIX] mis_builder: Use established QWeb pattern for first cell access
Replace complex generator expression with proven foreach+break pattern used throughout mis_builder codebase. - Use t-foreach with flag variable to find first non-empty cell - Follow existing template patterns from cell iteration - Add proper defensive checks for None cells - Use consistent naming with potential_first_cell variable Fixes QWeb template engine compatibility issues with generator expressions
1 parent f9f524e commit 2bd9a20

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

mis_builder/report/mis_report_instance_qweb.xml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,26 @@
111111
</t>
112112
<div class="mis_cell">
113113
<t
114-
t-set="first_cell"
115-
t-value="next((c for c in row.iter_cells() if c), None)"
114+
t-set="first_cell_found"
115+
t-value="False"
116116
/>
117-
<t t-if="first_cell">
117+
<t
118+
t-foreach="row.iter_cells()"
119+
t-as="potential_first_cell"
120+
>
118121
<t
119-
t-if="(cell_notes or {}).get(first_cell.cell_id)"
122+
t-if="not first_cell_found and potential_first_cell and potential_first_cell.cell_id"
120123
>
121124
<t
122-
t-out="(cell_notes.get(first_cell.cell_id) or {}).get('text', '')"
125+
t-if="(cell_notes or {}).get(potential_first_cell.cell_id)"
126+
>
127+
<t
128+
t-out="(cell_notes.get(potential_first_cell.cell_id) or {}).get('text', '')"
129+
/>
130+
</t>
131+
<t
132+
t-set="first_cell_found"
133+
t-value="True"
123134
/>
124135
</t>
125136
</t>

0 commit comments

Comments
 (0)