Skip to content

Commit

Permalink
[FIX] FIX sale report: Request is not available in cron excutions. (E…
Browse files Browse the repository at this point in the history
….G. SO payment confirmation)

closes #634

Signed-off-by: Nicolas Mac Rouillon <nmr@adhoc.com.ar>
  • Loading branch information
filoquin authored and nicomacr committed Feb 10, 2023
1 parent a342dbd commit 2d0c000
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sale_ux/__manifest__.py
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Sale UX',
'version': "15.0.1.2.0",
'version': "15.0.1.3.0",
'category': 'Sales',
'sequence': 14,
'summary': '',
Expand Down
8 changes: 4 additions & 4 deletions sale_ux/views/sale_reports.xml
Expand Up @@ -2,18 +2,18 @@
<odoo>
<template id="report_saleorder" inherit_id="sale.report_saleorder_document">
<xpath expr="//table//tr/th[@name='th_description']" position="before">
<th t-if="request.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>
<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>
<xpath expr="//t[@t-foreach='doc.order_line']//td[@name='td_name']" position="before">
<td t-if="request.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" style="height:20px !important;width:20px !important;"><span t-if="request.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and line.product_id.image_256" t-field="line.product_id.image_256" t-options="{&quot;widget&quot;: &quot;image&quot;}"/></td>
<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" style="height:20px !important;width:20px !important;"><span t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and line.product_id.image_256" t-field="line.product_id.image_256" t-options="{&quot;widget&quot;: &quot;image&quot;}"/></td>
</xpath>
</template>
<template id="report_report_saleorder_document_inherit_sale_management" inherit_id="sale_management.report_saleorder_document_inherit_sale_management">
<xpath expr="//table//tr/th[@name='th_option_name']" position="before">
<th t-if="request.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>
<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>
<xpath expr="//td[@name='td_option_name']" position="before">
<td t-if="request.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" style="height:20px !important;width:20px !important;"><span t-if="request.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and option.product_id.image_256" t-field="option.product_id.image_256" t-options='{"widget": "image"}'/></td>
<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" style="height:20px !important;width:20px !important;"><span t-if="doc.env['ir.config_parameter'].sudo().get_param('sale_ux.show_product_image_on_report') and option.product_id.image_256" t-field="option.product_id.image_256" t-options='{"widget": "image"}'/></td>
</xpath>
</template>
</odoo>

0 comments on commit 2d0c000

Please sign in to comment.