Skip to content

Commit 3a49064

Browse files
committed
[FIX] account, *: wrap quantity uom in reports
*: l10n_gcc_invoice,l10n_it_stock_ddt,sale,stock,web Issue: Commit[1] introduced a `text-nowrap` on the quantity column, this unnecessarily crops the other columns if we use a long UoM. This commit adds a max-width and min-width to the UoM column and applies the text-nowrap to the quantity only, letting the long UoM wrap if too long. The min-width avoids unnecessarily wrapping on 2 lines when we have a long description, it's an arbitrary safeguard. task-4478718 [1]: odoo/odoo@344bdb1 closes odoo#194389 Signed-off-by: Quentin Wolfs (quwo) <[email protected]>
1 parent 6731163 commit 3a49064

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

addons/account/views/report_invoice.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@
135135
<td name="account_invoice_line_name">
136136
<span t-if="line.name" t-field="line.name" t-options="{'widget': 'text'}">Bacon Burger</span>
137137
</td>
138-
<td name="td_quantity" class="text-end text-nowrap">
139-
<span t-field="line.quantity">3.00</span>
138+
<td name="td_quantity" class="o_td_quantity text-end">
139+
<span t-field="line.quantity" class="text-nowrap">3.00</span>
140140
<span t-field="line.product_uom_id" groups="uom.group_uom">units</span>
141141
</td>
142142
<td name="td_price_unit" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">

addons/l10n_gcc_invoice/views/report_invoice.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@
278278
<td class="text-end">
279279
<span class="text-nowrap" t-field="line.price_unit"/>
280280
</td>
281-
<td class="text-end">
282-
<span t-field="line.quantity"/>
281+
<td class="o_td_quantity text-end">
282+
<span t-field="line.quantity" class="text-nowrap"/>
283283
<span t-field="line.product_uom_id" groups="uom.group_uom"/>
284284
</td>
285285
<td name="account_invoice_line_name">

addons/l10n_it_stock_ddt/report/l10n_it_ddt_report.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@
119119
<td>
120120
<span t-field="move.product_id"/>
121121
</td>
122-
<td>
123-
<span t-field="move.quantity"/>
122+
<td class="o_td_quantity">
123+
<span t-field="move.quantity" class="text-nowrap"/>
124124
<span t-field="move.product_uom" groups="uom.group_uom"/>
125125
</td>
126126
<td t-if="display_discount">

addons/sale/report/ir_actions_report_templates.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@
106106
>
107107
<t t-if="not line.display_type and line.product_type != 'combo'">
108108
<td name="td_name"><span t-field="line.name">Bacon Burger</span></td>
109-
<td name="td_quantity" t-attf-class="text-end {{ 'text-nowrap' if (not line.product_packaging_id or len(line.product_packaging_id.name) &lt; 10) else '' }}">
110-
<span t-field="line.product_uom_qty">3</span>
109+
<td name="td_quantity" class="o_td_quantity text-end">
110+
<span t-field="line.product_uom_qty" class="text-nowrap">3</span>
111111
<span t-field="line.product_uom">units</span>
112112
<span t-if="line.product_packaging_id">
113113
(<span t-field="line.product_packaging_qty" t-options='{"widget": "integer"}'/> <span t-field="line.product_packaging_id"/>)

addons/stock/report/report_deliveryslip.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@
7575
<span t-field="move.description_picking">Description on transfer</span>
7676
</p>
7777
</td>
78-
<td class="text-end">
79-
<span t-field="move.product_uom_qty">3.00</span>
78+
<td class="o_td_quantity text-end">
79+
<span t-field="move.product_uom_qty" class="text-nowrap">3.00</span>
8080
<span t-field="move.product_uom" groups="uom.group_uom">units</span>
8181
<span t-if="move.product_packaging_id">
8282
(<span t-field="move.product_packaging_qty" t-options='{"widget": "integer"}'/> <span t-field="move.product_packaging_id"/>)
8383
</span>
8484
</td>
85-
<td class="text-end">
86-
<span t-field="move.quantity">3.00</span>
85+
<td class="o_td_quantity text-end">
86+
<span t-field="move.quantity" class="text-nowrap">3.00</span>
8787
<span t-field="move.product_uom" groups="uom.group_uom">units</span>
8888
<span t-if="move.product_packaging_id">
8989
(<span t-field="move.product_packaging_quantity" t-options='{"widget": "integer"}'/> <span t-field="move.product_packaging_id"/>)

addons/stock/report/report_stockinventory.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
<td><span t-field="line.product_id">Laptop</span></td>
3636
<td groups="stock.group_production_lot"><span t-field="line.lot_id"/></td>
3737
<td groups="stock.group_tracking_lot"><span t-field="line.package_id"/></td>
38-
<td class="text-end"><span t-field="line.available_quantity">2</span> <span t-field="line.product_uom_id" groups="uom.group_uom">Units</span></td>
39-
<td class="text-end"><span t-field="line.quantity">5</span> <span t-field="line.product_uom_id" groups="uom.group_uom">Units</span></td>
40-
<td class="text-end">
38+
<td class="o_td_quantity text-end"><span t-field="line.available_quantity" class="text-nowrap">2</span> <span t-field="line.product_uom_id" groups="uom.group_uom">Units</span></td>
39+
<td class="o_td_quantity text-end"><span t-field="line.quantity" class="text-nowrap">5</span> <span t-field="line.product_uom_id" groups="uom.group_uom">Units</span></td>
40+
<td class="o_td_quantity text-end">
4141
<!-- If 0, then leave blank so users have space to write a number -->
4242
<t t-if="line.inventory_quantity == 0"><span></span></t>
43-
<t t-else=""><span t-field="line.inventory_quantity">7</span></t>
43+
<t t-else=""><span t-field="line.inventory_quantity" class="text-nowrap">7</span></t>
4444
<span t-field="line.product_uom_id" groups="uom.group_uom">Units</span>
4545
</td>
4646
</tr>

addons/stock/report/report_stockpicking_operations.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118
<span t-field="ml.product_id.display_name">Customizable Desk</span><br/>
119119
<span t-if="ml.product_id.description_picking" t-field="ml.product_id.description_picking"></span>
120120
</td>
121-
<td class="text-end">
122-
<span t-field="ml.quantity">3.00</span>
121+
<td class="o_td_quantity text-end">
122+
<span t-field="ml.quantity" class="text-nowrap">3.00</span>
123123
<span t-field="ml.product_uom_id" groups="uom.group_uom">units</span>
124124
<span t-if="ml.move_id.product_packaging_id">
125125
<span t-if="o.state != 'done'">

addons/web/static/src/webclient/actions/reports/report.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ span[itemprop="streetAddress"] {
159159
white-space: normal;
160160
}
161161

162+
// Force a max width on quantity column to handle long UoM
163+
.o_td_quantity {
164+
min-width: 7rem;
165+
max-width: 9rem;
166+
}
167+
162168
// Override html_editor display styles as it uses 'calc' which doesn't work with wkhtmltopdf
163169
.display-1-fs {
164170
font-size: 6rem;

0 commit comments

Comments
 (0)