[FIX] account,sale: colspan revert part of e2e27b41a

In e2e27b41a variable `colspan` and several `<t t-set="colspan"/>` were
removed replacing `t-att-colspan="colspan"` with `colspan="99"`.

- sale_management.sale_order_portal_content_inherit_sale_management has
  `<t t-set="colspan" t-value="colspan+1"/>` overidding the portal view
  sale.sale_order_portal_content which so may result in error 500
  because colspan variable does not exist

- when doing a customization adding a column, adding:
  `<t t-set="colspan" t-value="colspan + 1"/>` was the expected behavior
  which after colspan change would break

So this changeset reintroduce `<t t-set="colspan"/>` tag up to not
including master, they will have no effect but possible existing xpath
or use of the variable colspan will no longer cause an error.

note: for 12.0 up to saas-12.3 (not necessary in master)
opw-1965886
closes #32539

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2019-04-09 08:29:39 +00:00
parent 7d31b863ca
commit a540f7864a
4 changed files with 13 additions and 0 deletions
+4
View File
@@ -51,12 +51,16 @@
<table class="table table-sm o_main_table" name="invoice_line_table">
<thead>
<tr>
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="6"/>
<th class="text-left"><span>Description</span></th>
<th class="d-none text-left"><span>Source Document</span></th>
<th class="text-right"><span>Quantity</span></th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Unit Price</span></th>
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Disc.(%)</span>
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Taxes</span></th>
<th class="text-right">
@@ -70,11 +70,15 @@
<table class="table table-sm o_main_table">
<thead>
<tr>
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="5"/>
<th class="text-left">Description</th>
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">
<span>Disc.(%)</span>
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th class="text-right">Taxes</th>
<th class="text-right">
@@ -428,11 +428,15 @@
<table class="table table-sm" id="sales_order_table">
<thead class="bg-100">
<tr>
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="6"/>
<th class="text-left">Products</th>
<th class="text-right">Quantity</th>
<th t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Unit Price</th>
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<span>Discount</span>
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="colspan+1"/>
</th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">Taxes</th>
<th class="text-right" >
@@ -15,6 +15,7 @@
<xpath expr="//section[@id='details']//table[@id='sales_order_table']/thead/tr" position="inside">
<th t-if="display_remove">
<!-- TODO: remove in master -->
<t t-set="colspan" t-value="colspan+1"/>
</th>
</xpath>