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