changes
This commit is contained in:
@@ -165,9 +165,37 @@
|
||||
</td>
|
||||
</xpath>
|
||||
|
||||
<!-- 4. Fix section/subsection colspan: add 1 for the new SKU column -->
|
||||
<xpath expr="//td[@name='line_name_td']" position="attributes">
|
||||
<attribute name="t-att-colspan">(1 if is_product else line_colspan + 1)</attribute>
|
||||
</template>
|
||||
|
||||
<!-- ================================================================= -->
|
||||
<!-- Default Sale Order Report: Add SKU column, clean description -->
|
||||
<!-- ================================================================= -->
|
||||
<template id="report_saleorder_sku_column"
|
||||
inherit_id="sale.report_saleorder_document">
|
||||
|
||||
<!-- 1. Add SKU header before Description -->
|
||||
<xpath expr="//th[@name='th_description']" position="before">
|
||||
<th name="th_sku" class="text-start" style="width: 12%;"><span>SKU</span></th>
|
||||
</xpath>
|
||||
|
||||
<!-- 2. Add SKU cell before description for product lines -->
|
||||
<xpath expr="//td[@name='td_product_name']" position="before">
|
||||
<td name="td_sku" class="text-start">
|
||||
<span t-esc="line.product_id.default_code or ''"/>
|
||||
</td>
|
||||
</xpath>
|
||||
|
||||
<!-- 3. Replace description to strip [internal_ref] prefix -->
|
||||
<xpath expr="//td[@name='td_product_name']" position="replace">
|
||||
<td name="td_product_name" t-att-class="padding_class">
|
||||
<t t-if="line.name">
|
||||
<t t-set="clean_desc" t-value="line.name"/>
|
||||
<t t-if="'] ' in (line.name or '')">
|
||||
<t t-set="clean_desc" t-value="line.name.split('] ', 1)[1]"/>
|
||||
</t>
|
||||
<span t-out="clean_desc" t-options="{'widget': 'text'}"/>
|
||||
</t>
|
||||
</td>
|
||||
</xpath>
|
||||
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user