[IMP] Adapt barcodes on picking report, warehouse should be passed from move picking...
authorJosse Colpaert <jco@odoo.com>
Tue, 10 Jun 2014 14:06:52 +0000 (16:06 +0200)
committerJosse Colpaert <jco@odoo.com>
Tue, 10 Jun 2014 14:06:52 +0000 (16:06 +0200)
addons/mrp_repair/views/report_mrprepairorder.xml
addons/stock/security/stock_security.xml
addons/stock/stock.py
addons/stock/views/report_stockpicking.xml

index 2897fee..a6d00ba 100644 (file)
@@ -30,7 +30,7 @@
 
                     <h2>
                         <span t-if="o.state != 'draft'">Repair Order N°:</span>
-                        <span t-if="o.state == 'draft'">Repair Quotation N°:</span>                        
+                        <span t-if="o.state == 'draft'">Repair Quotation N°:</span>
                         <span t-field="o.name"/>
                     </h2>
 
@@ -41,7 +41,9 @@
                         </div>
                         <div class="col-xs-3" groups="stock.group_production_lot">
                             <strong>Lot Number</strong>
-                            <span t-field="o.prodlot_id.name"/>
+                            <t t-if="o.lot_id">
+                                <span t-field="o.lot_id.name"/>
+                            </t>
                         </div>
                         <div t-if="o.guarantee_limit" class="col-xs-3">
                             <strong>Guarantee Limit:</strong>
index f44d354..044ff13 100644 (file)
@@ -50,7 +50,7 @@
         <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
     </record>
     
-    <record model="ir.rule" id="stock_picking_rule">
+    <record model="ir.rule" id="stock_picking_type_rule">
         <field name="name">Stock Picking Type multi-company</field>
         <field name="model_id" search="[('model','=','stock.picking.type')]" model="ir.model"/>
         <field name="global" eval="True"/>
index b65c718..e29f4cc 100644 (file)
@@ -1789,7 +1789,7 @@ class stock_move(osv.osv):
             'move_dest_id': move.id,
             'group_id': group_id,
             'route_ids': [(4, x.id) for x in move.route_ids],
-            'warehouse_id': move.warehouse_id and move.warehouse_id.id or False,
+            'warehouse_id': move.warehouse_id.id or (move.picking_type_id and move.picking_type_id.warehouse_id.id or False),
             'priority': move.priority,
         }
 
index d8d0ac4..7d2bb12 100644 (file)
@@ -6,16 +6,16 @@
                 <t t-foreach="docs" t-as="o">
                     <t t-call="report.external_layout">
                         <div class="page">
-                            <div class="row"><div class="col-xs-12">
-                            <img t-att-src="'/report/barcode/?type=%s&amp;value=%s' % ('Code128', o.name)" style="width:300px;height:50px;text-align:right;"/>
+                            <div class="row"><div class="col-xs-4 pull-right">
+                            <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px;"/>
                             </div></div>
-                             <div t-if="o.picking_type_id.code=='incoming'">
+                             <div t-if="o.picking_type_id.code=='incoming' and o.partner_id">
                                  <span><strong>Supplier Address:</strong></span>
                              </div>
-                             <div t-if="o.picking_type_id.code=='internal'">
+                             <div t-if="o.picking_type_id.code=='internal' and o.partner_id">
                                  <span><strong>Warehouse Address:</strong></span>
                              </div>
-                             <div t-if="o.picking_type_id.code=='outgoing'">
+                             <div t-if="o.picking_type_id.code=='outgoing' and o.partner_id">
                                  <span><strong>Customer Address:</strong></span>
                              </div>
                              <div t-if="o.partner_id" name="partner_header">
                                             <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', pack_operation.lot_id.name, 600, 100)" style="width:300px;height:50px"/>
                                         </span>
                                         <span t-if="pack_operation.product_id and not pack_operation.lot_id and pack_operation.product_id.ean13">
-                                            <img t-att-src="'/report/barcode/?type=%s&amp;value=%s' % ('EAN13', pack_operation.product_id.ean13)" style="width:300px;height:50px"/>
+                                            <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', pack_operation.product_id.ean13, 600, 100)" style="width:300px;height:50px"/>
                                         </span>
                                         <span t-if="pack_operation.package_id and not pack_operation.product_id">
                                             <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', pack_operation.package_id.name, 600, 100)" style="width:300px;height:50px"/>