Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sale_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
"name": "Sale UX",
"version": "18.0.1.14.0",
"version": "18.0.1.15.0",
"category": "Sales",
"sequence": 14,
"summary": "",
Expand Down
26 changes: 16 additions & 10 deletions sale_ux/views/sale_reports.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<template id="report_saleorder" inherit_id="sale.report_saleorder_document">
<xpath expr="//table//tr/th[@name='th_description']" position="before">
<th t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and any(x.image_256 for x in doc.order_line.mapped('product_id'))" name="th_image" class="text-left">Image</th>
<xpath expr="//t[@t-set='display_discount']" position="after">
<t t-set="show_images" t-value="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report')"/>
</xpath>
<xpath expr="//t[@t-foreach='lines_to_report']//td[@name='td_name']" position="before">
<td t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and any(x.image_256 for x in doc.order_line.mapped('product_id'))" name="td_image" class="text-center">
<img t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and line.product_id.image_256" t-att-src="image_data_uri(line.product_id.image_256)" style="max-width: 50px; max-height: 50px;"/>
<th name="th_description" position="before">
<th t-if="show_images" name="th_image" class="text-center" style="width: 60px;">Image</th>
</th>
<td name="td_name" position="before">
<td t-if="show_images" name="td_image" class="text-center" style="width: 60px;">
<span t-if="line.product_id.image_128" t-field="line.product_id.image_128" t-options='{"widget": "image", "class": "img img-fluid", "style": "max-width: 50px; max-height: 50px; display: block; margin: auto;"}'/>
</td>
</xpath>
</td>
</template>
<template id="report_report_saleorder_document_inherit_sale_management" inherit_id="sale_management.report_saleorder_document_inherit_sale_management">
<xpath expr="//table//tr/td[@name='th_option_name']" position="before">
<th t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and any(x.image_256 for x in doc.sale_order_option_ids.mapped('product_id'))" name="th_image" class="text-left">Image</th>
<xpath expr="//t[@t-set='display_discount']" position="after">
<t t-set="show_images" t-value="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report')"/>
</xpath>
<xpath expr="//td[@name='th_option_name']" position="before">
<td t-if="show_images" name="th_image_option" class="text-center" style="width: 60px;">Image</td>
</xpath>
<xpath expr="//td[@name='td_option_name']" position="before">
<td t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and any(x.image_256 for x in doc.sale_order_option_ids.mapped('product_id'))" name="td_image" class="text-center">
<img t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and line.product_id.image_256" t-att-src="image_data_uri(option.product_id.image_256)" style="max-width: 50px; max-height: 50px;"/>
<td t-if="show_images" name="td_image_option" class="text-center" style="width: 60px;">
<img t-if="option.product_id.image_128" t-att-src="image_data_uri(option.product_id.image_128)" style="max-width: 50px; max-height: 50px;"/>
</td>
</xpath>
</template>
Expand Down