Hardik Ansodariya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-576501-han into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-576501-han/+merge/113338

Hello,

I have fixed the issue of "Table header is not translated on subsequent pages 
of Purchase Order and Request For Quotation report".

Steps:
* Create a customer test and set his language to the loaded translation (e.g 
Dutch).
* Create a purchase order for customer test
* Create enough purchase order lines so the report will span more than one page
* Print the Request for Quotation report.

On this report, the table headers on the second page will be in english 
although those on the first page are in Dutch.

Referencing Maintenance Case: 576501

Kindly review it.

Thanks
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-576501-han/+merge/113338
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-576501-han.
=== modified file 'purchase/report/order.rml'
--- purchase/report/order.rml	2011-05-26 08:47:40 +0000
+++ purchase/report/order.rml	2012-07-04 06:41:22 +0000
@@ -131,31 +131,31 @@
   <story>
   <pto>
   <pto_header>
-    <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
-      <tr>
-        <td>
-          <para style="terp_tblheader_General">Description</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_General">Taxes</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_General">Date Req.</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_General_Right">Qty</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_General_Right">Unit Price</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_General_Right">Net Price</para>
-        </td>
-      </tr>
-    </blockTable>
-  </pto_header>
     <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
     <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
+    <blockTable colWidths="180.0,70.0,60.0,80.0,60.0,85.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
+      <tr>
+        <td>
+          <para style="terp_tblheader_General">Description</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General">Taxes</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General">Date Req.</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right">Qty</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right">Unit Price</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right">Net Price</para>
+        </td>
+      </tr>
+    </blockTable>
+  </pto_header>
     <para style="terp_default_9">
       <font color="white"> </font>
     </para>

=== modified file 'purchase/report/request_quotation.rml'
--- purchase/report/request_quotation.rml	2011-09-08 11:19:51 +0000
+++ purchase/report/request_quotation.rml	2012-07-04 06:41:22 +0000
@@ -71,22 +71,22 @@
   <story>
   <pto>
   <pto_header>
-    <blockTable colWidths="371.0,98.0,61.0" repeatRows="1" style="Table_Product_Header_Title">
-      <tr>
-        <td>
-          <para style="terp_tblheader_Details">Description</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_Details_Centre">Expected Date</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_Details_Centre">Qty</para>
-        </td>
-      </tr>
-    </blockTable>
-  </pto_header>
     <para style="terp_default_9">[[repeatIn(objects,'order')]]</para>
     <para style="terp_default_9">[[ setLang(order.partner_id.lang) ]]</para>
+    <blockTable colWidths="371.0,98.0,61.0" repeatRows="1" style="Table_Product_Header_Title">
+      <tr>
+        <td>
+          <para style="terp_tblheader_Details">Description</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_Details_Centre">Expected Date</para>
+        </td>
+        <td>
+          <para style="terp_tblheader_Details_Centre">Qty</para>
+        </td>
+      </tr>
+    </blockTable>
+  </pto_header>
     <blockTable colWidths="250.0,59.0,221.0" style="Table_Address_Detail">
       <tr>
         <td>
@@ -180,4 +180,4 @@
     <para style="terp_default_9">[[ user.signature or '' ]]</para>
   </pto>
   </story>
-</document>
\ No newline at end of file
+</document>

=== modified file 'sale/sale.py'
--- sale/sale.py	2012-06-29 14:14:29 +0000
+++ sale/sale.py	2012-07-04 06:41:22 +0000
@@ -811,6 +811,32 @@
         return False
 sale_order()
 
+class procurement_order(osv.osv):
+    _inherit = 'procurement.order'
+    
+    def _quantity_compute_get(self, cr, uid, proc, context=None):
+        """ Computes only quantity of product that were Delivered and also computes the quantity of returned products.
+        @param proc: Current procurement.
+        @return: Quantity or False.
+        """
+        if proc.product_id.type == 'product' and proc.move_id:
+            move_obj = self.pool.get('stock.move')
+            sale_id = proc.move_id.picking_id.sale_id.id
+            picking_ids = self.pool.get('stock.picking').search(cr, uid, [('sale_id', '=', sale_id), ('state', '=', 'done'), ('type', '=', 'out')], context=context)
+            returned_picking_ids = self.pool.get('stock.picking').search(cr, uid, [('sale_id', '=', sale_id), ('state', '=', 'done'), ('type', '=', 'in')], context=context)
+            qty_uos = 0
+            for returned_picking_id in returned_picking_ids:
+                 move_ids = move_obj.search(cr, uid, [('picking_id', '=', returned_picking_id)], context=context)
+                 qty_uos = move_obj.browse(cr, uid, move_ids, context=context)[0].product_uos_qty
+            qty_uos = -qty_uos
+            for picking_id in picking_ids:
+                move_ids = move_obj.search(cr, uid, [('picking_id', '=', picking_id)], context=context)
+                qty_uos = move_obj.browse(cr, uid, move_ids, context=context)[0].product_uos_qty
+            return qty_uos
+        return False
+	    
+procurement_order()
+
 # TODO add a field price_unit_uos
 # - update it on change product and unit price
 # - use it in report if there is a uos

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to