1
votes

While print a custom qweb report i am getting following error in odoo 10

Error to render compiling AST
MemoryError: 
Template: report.html_container
Path: /templates/t/t[2]/t
Node: <t t-raw="0"/>

I am sending 2 lists and 1 dictionary to xml.my code

<t t-foreach="qlty" t-as="q">
     <t t-foreach="qlty_des" t-as="qld">
          <t t-foreach="val" t-as="prd">
                 <tr style="border:1px solid black;">
                    <t t-if="prd['quality'] == q">
                           <t t-if="prd['quality'] == qld[0]">
                                <t t-if="prd['design'] == qld[1]">
                                  <td width="16%"  class="text-center">
                                           <span t-esc="prd['size']" />
                                  </td>
                                                              
                                  <td width="16%"  class="text-center">
                                       <span t-esc="prd['bs_col']" />
                                  </td>
                                                              
                                  <td width="16%"  class="text-center">
                                      <span t-esc="prd['brd_col']" />
                                  </td>
                                                              
                                  <td width="15%"  class="text-center">
                                      <span t-esc="prd['quantity']" />
                                  <t t-set="quantity" t-value="quantity + prd['quantity']" />
                                  /td>
                                                              
                                    <td width="15%"  class="text-center">
                                                            
                                       <span t-esc="prd['area']" />
                                    <t t-set="area" t-value="area + prd['area']" />
                                                               
                                   </td>
                                                              
                                                              
                             </t><!-- end of "prd['design'] == qld[1]-->  
                       </t><!-- end of "prd['quality'] == qld[0]-->   
                    </t> <!-- end of prd['quality'] == q"-->
                                                    
               </tr>
         </t>
        </t>
        <t t-set="ql_count" t-value="0"/> 
     </t>   

this code works fine for less no of records print.but when no of records increases, my system hangs and the above error occurs. please suggest how to resolve it

1
Look Like the Issue in your Looping. You have 3 loop iterate and while you have max record to print it can not be fulfilled with logic some mismatch [data & condition] obtain and report to print stop. - Dipen Shah

1 Answers

0
votes

Memmory error occurs means you have that your program somehow creates too many objects.

Please optimize your python code , your variable contains too much data to handle.

  • Another solution is upon your system's (32 or 64 bit.), but personally I think you need to optimize your python code.