Merge lp:~openbig/bigconsulting/added_report_barcode_check into lp:bigconsulting
- added_report_barcode_check
- Merge into addons
Proposed by
gpa(OpenERP)
Status: | Merged |
---|---|
Merged at revision: | 31 |
Proposed branch: | lp:~openbig/bigconsulting/added_report_barcode_check |
Merge into: | lp:bigconsulting |
Diff against target: |
270 lines (+212/-5) 7 files modified
packing_barcode_check/__init__.py (+1/-0) packing_barcode_check/__terp__.py (+1/-0) packing_barcode_check/packing_barcode_check_report.xml (+15/-0) packing_barcode_check/report/__init__.py (+26/-0) packing_barcode_check/report/bar_code_check.py (+35/-0) packing_barcode_check/report/bar_code_check.rml (+127/-0) packing_barcode_check/wizard/scan_product.py (+7/-5) |
To merge this branch: | bzr merge lp:~openbig/bigconsulting/added_report_barcode_check |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
openbig | Pending | ||
Review via email: mp+28397@code.launchpad.net |
Commit message
Description of the change
Added report and changes in the scan product wizard code scan any number of packaging.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'packing_barcode_check/__init__.py' |
2 | --- packing_barcode_check/__init__.py 2010-06-23 14:49:06 +0000 |
3 | +++ packing_barcode_check/__init__.py 2010-06-24 12:22:25 +0000 |
4 | @@ -22,4 +22,5 @@ |
5 | |
6 | import packing_barcode_check |
7 | import wizard |
8 | +import report |
9 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
10 | \ No newline at end of file |
11 | |
12 | === modified file 'packing_barcode_check/__terp__.py' |
13 | --- packing_barcode_check/__terp__.py 2010-06-23 14:49:06 +0000 |
14 | +++ packing_barcode_check/__terp__.py 2010-06-24 12:22:25 +0000 |
15 | @@ -33,6 +33,7 @@ |
16 | "init_xml" : [], |
17 | "update_xml" : ["packing_barcode_check_view.xml", |
18 | "packing_barcode_check_wizard.xml", |
19 | + "packing_barcode_check_report.xml", |
20 | ], |
21 | "active": False, |
22 | "installable": True |
23 | |
24 | === added file 'packing_barcode_check/packing_barcode_check_report.xml' |
25 | --- packing_barcode_check/packing_barcode_check_report.xml 1970-01-01 00:00:00 +0000 |
26 | +++ packing_barcode_check/packing_barcode_check_report.xml 2010-06-24 12:22:25 +0000 |
27 | @@ -0,0 +1,15 @@ |
28 | +<?xml version="1.0"?> |
29 | +<openerp> |
30 | + <data> |
31 | + |
32 | + <report id="report_packing_barcode_check" |
33 | + string="Print Scanlist Report" |
34 | + model="stock.picking" |
35 | + name="barcode.check" |
36 | + rml="packing_barcode_check/report/bar_code_check.rml" |
37 | + auto="False" |
38 | + header="False" |
39 | + menu="True" /> |
40 | + |
41 | + </data> |
42 | +</openerp> |
43 | |
44 | === added directory 'packing_barcode_check/report' |
45 | === added file 'packing_barcode_check/report/__init__.py' |
46 | --- packing_barcode_check/report/__init__.py 1970-01-01 00:00:00 +0000 |
47 | +++ packing_barcode_check/report/__init__.py 2010-06-24 12:22:25 +0000 |
48 | @@ -0,0 +1,26 @@ |
49 | +# -*- encoding: utf-8 -*- |
50 | +############################################################################## |
51 | +# |
52 | +# OpenERP, Open Source Management Solution |
53 | +# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. |
54 | +# Jordi Esteve <jesteve@zikzakmedia.com> |
55 | +# $Id$ |
56 | +# |
57 | +# This program is free software: you can redistribute it and/or modify |
58 | +# it under the terms of the GNU General Public License as published by |
59 | +# the Free Software Foundation, either version 3 of the License, or |
60 | +# (at your option) any later version. |
61 | +# |
62 | +# This program is distributed in the hope that it will be useful, |
63 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
64 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
65 | +# GNU General Public License for more details. |
66 | +# |
67 | +# You should have received a copy of the GNU General Public License |
68 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
69 | +# |
70 | +############################################################################## |
71 | + |
72 | +import bar_code_check |
73 | + |
74 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
75 | \ No newline at end of file |
76 | |
77 | === added file 'packing_barcode_check/report/bar_code_check.py' |
78 | --- packing_barcode_check/report/bar_code_check.py 1970-01-01 00:00:00 +0000 |
79 | +++ packing_barcode_check/report/bar_code_check.py 2010-06-24 12:22:25 +0000 |
80 | @@ -0,0 +1,35 @@ |
81 | +# -*- encoding: utf-8 -*- |
82 | +############################################################################## |
83 | +# |
84 | +# OpenERP, Open Source Management Solution |
85 | +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved |
86 | +# $Id$ |
87 | +# |
88 | +# This program is free software: you can redistribute it and/or modify |
89 | +# it under the terms of the GNU General Public License as published by |
90 | +# the Free Software Foundation, either version 3 of the License, or |
91 | +# (at your option) any later version. |
92 | +# |
93 | +# This program is distributed in the hope that it will be useful, |
94 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
95 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
96 | +# GNU General Public License for more details. |
97 | +# |
98 | +# You should have received a copy of the GNU General Public License |
99 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
100 | +# |
101 | +############################################################################## |
102 | + |
103 | +import time |
104 | +from report import report_sxw |
105 | + |
106 | +class report_generator(report_sxw.rml_parse): |
107 | + def __init__(self, cr, uid, name, context): |
108 | + super(report_generator, self).__init__(cr, uid, name, context=context) |
109 | + self.localcontext.update({ |
110 | + 'time': time, |
111 | + }) |
112 | +report_sxw.report_sxw('report.barcode.check','stock.picking','addons/packing_barcode_check/report/bar_code_check.rml',parser=report_generator) |
113 | + |
114 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
115 | + |
116 | |
117 | === added file 'packing_barcode_check/report/bar_code_check.rml' |
118 | --- packing_barcode_check/report/bar_code_check.rml 1970-01-01 00:00:00 +0000 |
119 | +++ packing_barcode_check/report/bar_code_check.rml 2010-06-24 12:22:25 +0000 |
120 | @@ -0,0 +1,127 @@ |
121 | +<?xml version="1.0"?> |
122 | +<document filename="test.pdf"> |
123 | + <template pageSize="(320.0,210.0)" rightMargin="0.0cm" title="Test" author="Martin Simon" allowSplitting="20"> |
124 | + <pageTemplate id="first"> |
125 | + <frame id="first" x1="1.5cm" y1="0.0cm" width="320.0" height="210"/> |
126 | + </pageTemplate> |
127 | + </template> |
128 | + <stylesheet> |
129 | + <blockTableStyle id="Standard_Outline"> |
130 | + <blockAlignment value="LEFT"/> |
131 | + <blockValign value="TOP"/> |
132 | + </blockTableStyle> |
133 | + <blockTableStyle id="Table1"> |
134 | + <blockAlignment value="LEFT"/> |
135 | + <blockValign value="TOP"/> |
136 | + </blockTableStyle> |
137 | + <initialize> |
138 | + <paraStyle name="all" alignment="justify"/> |
139 | + </initialize> |
140 | + <paraStyle name="Standard" fontName="Times-Roman"/> |
141 | + <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/> |
142 | + <paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/> |
143 | + <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/> |
144 | + <paraStyle name="Table Contents" fontName="Times-Roman"/> |
145 | + <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/> |
146 | + <paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/> |
147 | + <paraStyle name="Index" fontName="Times-Roman"/> |
148 | + <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="0.0"/> |
149 | + <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
150 | + <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
151 | + <paraStyle name="terp_default_Bold_12" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
152 | + <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
153 | + <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/> |
154 | + <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/> |
155 | + <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/> |
156 | + <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/> |
157 | + <paraStyle name="Footer" fontName="Times-Roman"/> |
158 | + <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/> |
159 | + <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/> |
160 | + <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/> |
161 | + <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/> |
162 | + <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/> |
163 | + <paraStyle name="terp_default_left_10" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
164 | + <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/> |
165 | + <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/> |
166 | + <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
167 | + <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/> |
168 | + <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
169 | + <paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
170 | + <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
171 | + <paraStyle name="terp_default_Italic" rightIndent="0.0" leftIndent="20.0" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
172 | + <paraStyle name="Preformatted Text" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/> |
173 | + <paraStyle name="terp_default_Centre_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/> |
174 | + <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
175 | + <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/> |
176 | + <images/> |
177 | + </stylesheet> |
178 | + <story> |
179 | + <para style="Standard">[[ repeatIn(objects,'picking') ]] </para> |
180 | + <section> |
181 | + <para style="terp_default_8">[[ repeatIn(picking.move_lines,'move_lines') ]]</para> |
182 | + <blockTable colWidths="143.0,180.0" style="Table1"> |
183 | + <tr> |
184 | + <td> |
185 | + <para style="terp_default_Bold_9">Product </para> |
186 | + </td> |
187 | + <td> |
188 | + <para style="terp_default_Bold_9">[[ move_lines.product_id.code or '']] </para> |
189 | + </td> |
190 | + </tr> |
191 | + <tr> |
192 | + <td> |
193 | + <para style="terp_default_Bold_9">Quantity</para> |
194 | + </td> |
195 | + <td> |
196 | + <para style="terp_default_Bold_9">[[ move_lines.product_qty or '']]</para> |
197 | + </td> |
198 | + </tr> |
199 | + <tr> |
200 | + <td> |
201 | + <para style="terp_default_Bold_9">Pack</para> |
202 | + </td> |
203 | + <td> |
204 | + <para style="terp_default_Bold_9">[[picking.name]]</para> |
205 | + </td> |
206 | + </tr> |
207 | + <tr> |
208 | + <td> |
209 | + <barCode code="code128" barWidth="1.4" barHeight="25">[[picking.name or removeParentNode('td')]]</barCode> |
210 | + </td> |
211 | + <td> |
212 | + </td> |
213 | + </tr> |
214 | + <tr> |
215 | + <td> |
216 | + <para style="terp_default_Bold_9">EAN</para> |
217 | + </td> |
218 | + <td> |
219 | + <para style="terp_default_Bold_9">[[ move_lines.product_packaging.ean or '']]</para> |
220 | + </td> |
221 | + </tr> |
222 | + <tr> |
223 | + <td> |
224 | + <barCode code="code128" barWidth="1.4" barHeight="25">[[move_lines.product_packaging.ean or removeParentNode('td')]]</barCode> |
225 | + </td> |
226 | + <td> |
227 | + </td> |
228 | + </tr> |
229 | + <tr> |
230 | + <td> |
231 | + <para style="terp_default_Bold_9">Production Lot</para> |
232 | + </td> |
233 | + <td> |
234 | + <para style="terp_default_Bold_9">[[ move_lines.prodlot_id.name or '']]</para> |
235 | + </td> |
236 | + </tr> |
237 | + <tr> |
238 | + <td> |
239 | + <barCode code="code128" barWidth="1.4" barHeight="25">[[move_lines.prodlot_id.name or removeParentNode('td')]]</barCode> |
240 | + </td> |
241 | + <td> |
242 | + </td> |
243 | + </tr> |
244 | + </blockTable> |
245 | + </section> |
246 | + </story> |
247 | +</document> |
248 | |
249 | === modified file 'packing_barcode_check/wizard/scan_product.py' |
250 | --- packing_barcode_check/wizard/scan_product.py 2010-06-23 14:49:06 +0000 |
251 | +++ packing_barcode_check/wizard/scan_product.py 2010-06-24 12:22:25 +0000 |
252 | @@ -47,11 +47,13 @@ |
253 | move_data = stock_move_obj.browse(cr, uid,move_id) |
254 | if move_data.product_qty == move_data.scaned_qty: |
255 | continue |
256 | - product_ean = move_data.product_id.ean13 |
257 | - |
258 | - if product_ean == form_ean: |
259 | - EAN_Found = True |
260 | - return 'scan_product_number' |
261 | + for ean_id in move_data.product_id.packaging: |
262 | + ean_data = pool.get("product.packaging").browse(cr, uid, ean_id.id) |
263 | + product_ean = ean_data.ean |
264 | + if product_ean == form_ean: |
265 | + EAN_Found = True |
266 | + return 'scan_product_number' |
267 | + |
268 | if not EAN_Found: |
269 | raise osv.except_osv(_('Warning!'),('Product does not belongs to this picking or already scanned.')) |
270 | return {} |