Skip to content

Commit

Permalink
[FIX] sale: force maximum section/subtotal width
Browse files Browse the repository at this point in the history
Step to reproduce:
- Install sale (sale_management) and studio (web_studio)
- Change the document template (settings > configuration > general
settings) to select the second one
- Go to an order form
- Enable studio, select "Reports" in the right tab
- Edit the "Quotation/Order" report, add a new colomn
- Back to the order form, enable dev mode and add a section to the order
lines.
- Print the report => the section is not using all the available place.

The section/subtotal are using a colspan to use all the place in the
table, this colspan is hardcoded to 5, the number of columns without
customization. Adding a new column doesn't change that value.

The fix has been to force the colspan at 99, the maximum value for
colspans. Using that value will always render the row to fill the table.

opw-1936088

closes #31951

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
  • Loading branch information
Julien00859 committed Mar 19, 2019
1 parent 8003289 commit 716ff76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/sale/report/sale_report_templates.xml
Expand Up @@ -116,22 +116,22 @@
</td> </td>
</t> </t>
<t t-if="line.display_type == 'line_section'"> <t t-if="line.display_type == 'line_section'">
<td t-att-colspan="colspan"> <td t-att-colspan="99">
<span t-field="line.name"/> <span t-field="line.name"/>
</td> </td>
<t t-set="current_section" t-value="line"/> <t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/> <t t-set="current_subtotal" t-value="0"/>
</t> </t>
<t t-if="line.display_type == 'line_note'"> <t t-if="line.display_type == 'line_note'">
<td t-att-colspan="colspan"> <td t-att-colspan="99">
<span t-field="line.name"/> <span t-field="line.name"/>
</td> </td>
</t> </t>
</tr> </tr>


<t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section')"> <t t-if="current_section and (line_last or doc.order_line[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-right"> <tr class="is-subtotal text-right">
<td t-att-colspan="colspan"> <td t-att-colspan="99">
<strong class="mr16">Subtotal</strong> <strong class="mr16">Subtotal</strong>
<span <span
t-esc="current_subtotal" t-esc="current_subtotal"
Expand Down

0 comments on commit 716ff76

Please sign in to comment.