Good afternoon all!
On the website attached pictures of each Contact (meant Partner) were shown as a gallery and everything was fine until yesterday when MemoryError occured:
Python code:
----
class WebsitePartnerPageInherit(WebsitePartnerPage):
@http.route(['/partners/<partner_id>'], type='http', auth="public", website=True)
def partners_detail(self, partner_id, **post):
res_par = super(WebsitePartnerPageInherit, self).partners_detail(partner_id, **post)
attach = request.env['ir.attachment'].search([('res_model', '=', 'res.partner')])
res_par.qcontext.update({'attach': attach})
return res_par
-------
Xxml-file:
--------------
<t t-foreach="attach" t-as="att" t-if="partner.id == att.res_id">
<div class="column-65">
<img id="image_style_2" t-attf-src="data:image/*;base64,{{att.datas}}"/>
<h1 class="large-font">
</h1>
</div>
</t>
-----------
Error:
Error to render compiling AST MemoryError: Template: website_partner.partner_detail Path: /t/div[2]/t/div/img Node: <img id="image_style_2" t-att-src="image_data_uri(att.datas)" data-oe-model="ir.ui.view" data-oe-id="2703" data-oe-field="arch" data-oe-xpath="/data/xpath/div[2]/t[1]/div[1]/img[1]"/>
Thanks a lot in advance!