Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get Virtual Stock and Real Stock in Report

By
sridhar
on 9/18/13, 12:09 PM 589 views

Hi all, How to get Virtual Stock and Real Stock in Report, I want list products and available quantity and virtual quantity, cost price report, i create a function for this my doubt is how can i put in rml.

def demo_product(self,form):    
    vals={}
    pro=self.pool.get('product.product')
    ids=pro.search(self.cr,self.uid,[])
    pro_len=pro.browse(self.cr,self.uid,ids)
    qty_available = 0.0     
    for line in pro_len:
        vals={'name':line.name_template,
            'code':line.default_code,
            'availqty':line.qty_available,
            'onhand':line.virtual_available,
            'virtualqty':line.incoming_qty,
            'outgoqty':line.outgoing_qty,
        }
    return vals

in my rml

<section>
        <para style="terp_default_9">[[ repeatIn(asimo_product('form'), 'vals') ]]</para>
<blockTable colWidths="75.71,75.71,75.71,75.71,75.71,75.71,75.71" style="Table1">
      <tr>
        <td>
          <para style="terp_tblheader_Details">[[ vals ['name_template'] ]]</para>
        </td>
        <td>
         <para style="terp_tblheader_Details"> [[ vals ['default_code'] ]]</para>
        </td>
        <td>
         <para style="terp_tblheader_Details">[[ vals ['incoming_qty'] ]]</para>
        </td>
        <td>
        <para style="terp_tblheader_Details">[[ vals ['outgoing_qty'] ]]</para>
        </td>
        <td>
        <para style="terp_tblheader_Details">[[ vals ['qty_available'] ]]</para>
        </td>
        <td>
         <para style="terp_tblheader_Details">[[ vals ['standard_price'] ]]</para>
        </td>
        <td>
         <para style="terp_tblheader_Details">[[ vals ['virtual_available'] ]]</para>
        </td>
      </tr>
    </blockTable>
   </section>

How I want to take a report 30nos product, forcast quantity available quantity are not in a database it is just function field, then how can i reterive it help advance.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/18/13, 12:09 PM
Seen: 589 times
Last updated: 3/16/15, 8:10 AM