[IMP]solve the bug of user's product report in pos module
authorsaz-OpenERP <azaz.201186@gmail.com>
Mon, 11 Oct 2010 11:27:14 +0000 (16:57 +0530)
committersaz-OpenERP <azaz.201186@gmail.com>
Mon, 11 Oct 2010 11:27:14 +0000 (16:57 +0530)
bzr revid: azaz.201186@gmail.com-20101011112714-cd4tq2mrkcdqt7xn

addons/point_of_sale/report/pos_users_product.py
addons/point_of_sale/report/pos_users_product.rml

index 141445b..63f75e4 100644 (file)
@@ -43,7 +43,7 @@ class pos_user_product(report_sxw.rml_parse):
         for r in data:
             a_l.append(r['id'])
         if len(a_l):
-            sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id IN %s and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit""",(tuple(a_l),)
+            sql2="""SELECT sum(qty) as qty,l.price_unit*sum(l.qty) as amt,t.name as name from product_product p, product_template t, pos_order_line l where order_id = %d and p.product_tmpl_id=t.id and l.product_id=p.id group by t.name, l.price_unit"""%(o.id)
             self.cr.execute(sql2)
             data = self.cr.dictfetchall()
         for d in data:
index 54c41dd..ce746b2 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <document filename="test.pdf">
-  <template pageSize="(595.0,842.0)" title="Product by user" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
+  <template pageSize="(595.0,842.0)" title="Users Product'" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
     <pageTemplate id="first">
       <frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
     </pageTemplate>
@@ -82,7 +82,6 @@
     </initialize>
     <paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
     <paraStyle name="P2" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
-    <paraStyle name="P3" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
     <paraStyle name="Standard" fontName="Helvetica"/>
     <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
     <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>