[IMP] website_portal_sale: display product images

on quotations and sales orders for portal users.
This commit is contained in:
Denis Vermylen
2017-01-10 14:34:19 +01:00
parent 8aa66e36a3
commit fd9b562efe
2 changed files with 10 additions and 2 deletions
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, exceptions, models
from odoo import api, exceptions, fields, models
class SaleOrder(models.Model):
@@ -55,3 +55,11 @@ class SaleOrder(models.Model):
action='/mail/view',
model=self._name,
res_id=self.id)[self.partner_id.id]
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
# Non-stored related field to allow portal user to see the image of the product he has ordered
product_image = fields.Binary('Product Image', related="product_id.image", store=False)
@@ -324,7 +324,7 @@
<t t-foreach="order.order_line" t-as="ol">
<div class="row orders_vertical_align">
<div class="col-md-1 text-center">
<img t-att-src="'/web/image/product.product/%s/image_small/48x48' % ol.product_id.id"/>
<img t-att-src="'/web/image/sale.order.line/%s/product_image/48x48' % ol.id"/>
</div>
<div id='product_name' class="col-md-5">
<span t-esc="ol.product_id.name"/>