Merge lp:~serpent-consulting-services/openerp-usa/packing_slip_report-fix into lp:openerp-usa/6.1.x

Proposed by Serpent Consulting Services
Status: Merged
Merged at revision: 63
Proposed branch: lp:~serpent-consulting-services/openerp-usa/packing_slip_report-fix
Merge into: lp:openerp-usa/6.1.x
Diff against target: 174 lines (+24/-26)
4 files modified
shipping_api/report/package_packing_slip.rml (+6/-8)
shipping_api/report/packing_slip.py (+8/-8)
shipping_api/stock_package_view.xml (+7/-7)
shipping_api/stock_packages.py (+3/-3)
To merge this branch: bzr merge lp:~serpent-consulting-services/openerp-usa/packing_slip_report-fix
Reviewer Review Type Date Requested Status
npg Pending
Review via email: mp+116944@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Thanks for merging.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shipping_api/report/package_packing_slip.rml'
2--- shipping_api/report/package_packing_slip.rml 2012-07-23 12:28:48 +0000
3+++ shipping_api/report/package_packing_slip.rml 2012-07-26 18:44:19 +0000
4@@ -343,12 +343,12 @@
5 <para style="P7">ORDER QTY</para>
6 </td>
7 <td>
8- <para style="P7">PICKED QTY</para>
9+ <para style="P7">PACKED QTY</para>
10 </td>
11 </tr>
12 </blockTable>
13 <section>
14- <para style="terp_default_2">[[repeatIn(package .package_item_ids,'item')]]</para>
15+ <para style="terp_default_2">[[repeatIn(package.package_item_ids,'item')]]</para>
16 <blockTable colWidths="126.0,223.0,79.0,79.0" style="Table8">
17 <tr>
18 <td>
19@@ -360,10 +360,10 @@
20 </para>
21 </td>
22 <td>
23- <para style="P20">[[_get_qty(item.package_id.pick_id.sale_id and item.package_id.pick_id.sale_id, item.product_id.id)]]</para>
24+ <para style="P20">[[ formatLang(_get_qty(item.package_id.pick_id.sale_id and item.package_id.pick_id.sale_id, item.product_id.id) or 0.0)]]</para>
25 </td>
26 <td>
27- <para style="P20">[[_get_pickedqty(item.package_id.pick_id, item.product_id.id)]]</para>
28+ <para style="P20">[[ formatLang(item.qty) ]]</para>
29 </td>
30 </tr>
31 </blockTable>
32@@ -378,12 +378,10 @@
33 <para style="P7">TOTAL QTY</para>
34 </td>
35 <td>
36- <para style="P21">[[_get_total(item.package_id.pick_id.sale_id and item.package_id.pick_id.sale_id, item.package_id)]]</para>
37+ <para style="P21">[[formatLang(_get_total(item.package_id.pick_id.sale_id and item.package_id.pick_id.sale_id, item.package_id))]]</para>
38 </td>
39 <td>
40- <para style="P21">
41- <font color="white"> </font>
42- </para>
43+ <para style="P21">[[formatLang(_get_total_packed_qty(package))]]</para>
44 </td>
45 </tr>
46 <tr>
47
48=== modified file 'shipping_api/report/packing_slip.py'
49--- shipping_api/report/packing_slip.py 2012-07-23 12:28:48 +0000
50+++ shipping_api/report/packing_slip.py 2012-07-26 18:44:19 +0000
51@@ -29,15 +29,15 @@
52 'time': time,
53 '_get_qty': self._get_qty,
54 '_get_total': self._get_total,
55- '_get_pickedqty': self._get_pickedqty,
56- '_get_count': self._get_count
57+ '_get_count': self._get_count,
58+ '_get_total_packed_qty': self._get_total_packed_qty
59 })
60
61 def _get_qty(self, sale, product_id):
62 qty = {}
63 for line in sale.order_line:
64 qty[line.product_id.id] = line.product_uom_qty
65- return str(qty[product_id])[:-1]
66+ return qty.get(product_id,0.0)
67
68 def _get_count(self, picking, package_id):
69 count = 0
70@@ -48,11 +48,11 @@
71 result = str(page[package_id])+ ' of ' + str(count)
72 return result
73
74- def _get_pickedqty(self, picking, product_id):
75- qty = {}
76- for move in picking.move_lines:
77- qty[move.product_id.id] = move.product_qty
78- return str(qty[product_id])[:-2]
79+ def _get_total_packed_qty(self, package):
80+ tot = 0
81+ for item in package.package_item_ids:
82+ tot += item.qty
83+ return tot
84
85 def _get_total(self, sale, package):
86 qty = {}
87
88=== modified file 'shipping_api/stock_package_view.xml'
89--- shipping_api/stock_package_view.xml 2012-07-23 12:28:48 +0000
90+++ shipping_api/stock_package_view.xml 2012-07-26 18:44:19 +0000
91@@ -38,21 +38,21 @@
92 <form string='Shipping Packages'>
93 <group colspan="4" col="4">
94 <group colspan="2" col="2">
95- <field name='packge_no' on_change="onchange_packge_no(parent.packages_ids,packge_no)"/>
96+ <field name='packge_no' on_change="onchange_packge_no(parent.packages_ids,packge_no)"/>
97+ <field name='package_type'/>
98 <field name='weight' on_change="onchange_weight(parent.packages_ids,parent.tot_del_order_weight, weight)"/>
99 <field name='length'/>
100 <field name='width'/>
101 <field name='height'/>
102- <field name='show_button' invisible="1"/>
103+ <field name='show_button'invisible="1"/>
104 </group>
105 <group colspan="2" col="2">
106 <field name='description'/>
107- <field name='package_type'/>
108 <field name='decl_val'/>
109 <field name='ref1'/>
110 <field name='ref2'/>
111 <group colspan="4" col="6">
112- <button string="Weigh" help='Click this button to weigh the package from the scale.' colspan="1"/>
113+ <button string="Weight" help='Click this button to weigh the package from the scale.' colspan="1"/>
114 <button string="Print Label" name="print_label" type="object" attrs="{'invisible':[('show_button','=', False)]}" colspan="1"
115 help='This prints a specific label for the package. This button also allows for reprinting a button. The label is stored in the document management system as a pdf.'/>
116 <button attrs="{'invisible':[('show_button','=', False)]}" string="Print Packing Slip" type="object" name="print_packing_slips" colspan="1"/>
117@@ -105,8 +105,8 @@
118 <field name="arch" type="xml">
119 <search string='Shipment Package Items'>
120 <field name="product_id"/>
121+ <field name="qty"/>
122 <field name="cost"/>
123- <field name="prod_lot_id"/>
124 </search>
125 </field>
126 </record>
127@@ -118,8 +118,8 @@
128 <field name="arch" type="xml">
129 <tree string='Shipment Package Items' editable='top'>
130 <field name="product_id" on_change='onchange_product_id(product_id)'/>
131+ <field name="qty"/>
132 <field name="cost"/>
133- <field name="prod_lot_id"/>
134 </tree>
135 </field>
136 </record>
137@@ -131,8 +131,8 @@
138 <field name="arch" type="xml">
139 <form string='Shipment Package Items'>
140 <field name="product_id" on_change='onchange_product_id(product_id)'/>
141+ <field name="qty"/>
142 <field name="cost"/>
143- <field name="prod_lot_id"/>
144 </form>
145 </field>
146 </record>
147
148=== modified file 'shipping_api/stock_packages.py'
149--- shipping_api/stock_packages.py 2012-07-23 12:28:48 +0000
150+++ shipping_api/stock_packages.py 2012-07-26 18:44:19 +0000
151@@ -170,7 +170,7 @@
152 _rec_name = 'product_id'
153
154 def onchange_product_id(self, cr, uid, ids, product_id):
155- res = {'value':{'name':'','cost':0.0}}
156+ res = {'value':{'cost':0.0}}
157 product_obj = self.pool.get('product.product')
158 if not product_id:
159 return res
160@@ -179,12 +179,12 @@
161 'cost' : prod.list_price or 0.0
162 }
163 return res
164-
165+
166 _columns = {
167 'product_id': fields.many2one('product.product','Product', required=True),
168 'cost': fields.float('Value',required=True),
169 'package_id': fields.many2one('stock.packages','Package'),
170- 'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot')
171+ 'qty': fields.float('Quantity'),
172 }
173
174 shipment_package_item()