Merge lp:~openbig/bigconsulting/added_report_barcode_check into lp:bigconsulting

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
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+28397@code.launchpad.net

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
=== modified file 'packing_barcode_check/__init__.py'
--- packing_barcode_check/__init__.py 2010-06-23 14:49:06 +0000
+++ packing_barcode_check/__init__.py 2010-06-24 12:22:25 +0000
@@ -22,4 +22,5 @@
2222
23import packing_barcode_check23import packing_barcode_check
24import wizard24import wizard
25import report
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
26\ No newline at end of file27\ No newline at end of file
2728
=== modified file 'packing_barcode_check/__terp__.py'
--- packing_barcode_check/__terp__.py 2010-06-23 14:49:06 +0000
+++ packing_barcode_check/__terp__.py 2010-06-24 12:22:25 +0000
@@ -33,6 +33,7 @@
33 "init_xml" : [],33 "init_xml" : [],
34 "update_xml" : ["packing_barcode_check_view.xml",34 "update_xml" : ["packing_barcode_check_view.xml",
35 "packing_barcode_check_wizard.xml",35 "packing_barcode_check_wizard.xml",
36 "packing_barcode_check_report.xml",
36 ],37 ],
37 "active": False,38 "active": False,
38 "installable": True39 "installable": True
3940
=== added file 'packing_barcode_check/packing_barcode_check_report.xml'
--- packing_barcode_check/packing_barcode_check_report.xml 1970-01-01 00:00:00 +0000
+++ packing_barcode_check/packing_barcode_check_report.xml 2010-06-24 12:22:25 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0"?>
2<openerp>
3 <data>
4
5 <report id="report_packing_barcode_check"
6 string="Print Scanlist Report"
7 model="stock.picking"
8 name="barcode.check"
9 rml="packing_barcode_check/report/bar_code_check.rml"
10 auto="False"
11 header="False"
12 menu="True" />
13
14 </data>
15</openerp>
016
=== added directory 'packing_barcode_check/report'
=== added file 'packing_barcode_check/report/__init__.py'
--- packing_barcode_check/report/__init__.py 1970-01-01 00:00:00 +0000
+++ packing_barcode_check/report/__init__.py 2010-06-24 12:22:25 +0000
@@ -0,0 +1,26 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
6# Jordi Esteve <jesteve@zikzakmedia.com>
7# $Id$
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24import bar_code_check
25
26# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
0\ No newline at end of file27\ No newline at end of file
128
=== added file 'packing_barcode_check/report/bar_code_check.py'
--- packing_barcode_check/report/bar_code_check.py 1970-01-01 00:00:00 +0000
+++ packing_barcode_check/report/bar_code_check.py 2010-06-24 12:22:25 +0000
@@ -0,0 +1,35 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6# $Id$
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23import time
24from report import report_sxw
25
26class report_generator(report_sxw.rml_parse):
27 def __init__(self, cr, uid, name, context):
28 super(report_generator, self).__init__(cr, uid, name, context=context)
29 self.localcontext.update({
30 'time': time,
31 })
32report_sxw.report_sxw('report.barcode.check','stock.picking','addons/packing_barcode_check/report/bar_code_check.rml',parser=report_generator)
33
34# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
35
036
=== added file 'packing_barcode_check/report/bar_code_check.rml'
--- packing_barcode_check/report/bar_code_check.rml 1970-01-01 00:00:00 +0000
+++ packing_barcode_check/report/bar_code_check.rml 2010-06-24 12:22:25 +0000
@@ -0,0 +1,127 @@
1<?xml version="1.0"?>
2<document filename="test.pdf">
3 <template pageSize="(320.0,210.0)" rightMargin="0.0cm" title="Test" author="Martin Simon" allowSplitting="20">
4 <pageTemplate id="first">
5 <frame id="first" x1="1.5cm" y1="0.0cm" width="320.0" height="210"/>
6 </pageTemplate>
7 </template>
8 <stylesheet>
9 <blockTableStyle id="Standard_Outline">
10 <blockAlignment value="LEFT"/>
11 <blockValign value="TOP"/>
12 </blockTableStyle>
13 <blockTableStyle id="Table1">
14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>
16 </blockTableStyle>
17 <initialize>
18 <paraStyle name="all" alignment="justify"/>
19 </initialize>
20 <paraStyle name="Standard" fontName="Times-Roman"/>
21 <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
22 <paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
23 <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
24 <paraStyle name="Table Contents" fontName="Times-Roman"/>
25 <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
26 <paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
27 <paraStyle name="Index" fontName="Times-Roman"/>
28 <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="0.0"/>
29 <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
30 <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
31 <paraStyle name="terp_default_Bold_12" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
32 <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
33 <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
34 <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
35 <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
36 <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
37 <paraStyle name="Footer" fontName="Times-Roman"/>
38 <paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
39 <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
40 <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
41 <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
42 <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
43 <paraStyle name="terp_default_left_10" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
44 <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
45 <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
46 <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
47 <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
48 <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
49 <paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
50 <paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
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"/>
52 <paraStyle name="Preformatted Text" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
53 <paraStyle name="terp_default_Centre_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
54 <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
55 <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
56 <images/>
57 </stylesheet>
58 <story>
59 <para style="Standard">[[ repeatIn(objects,'picking') ]] </para>
60 <section>
61 <para style="terp_default_8">[[ repeatIn(picking.move_lines,'move_lines') ]]</para>
62 <blockTable colWidths="143.0,180.0" style="Table1">
63 <tr>
64 <td>
65 <para style="terp_default_Bold_9">Product </para>
66 </td>
67 <td>
68 <para style="terp_default_Bold_9">[[ move_lines.product_id.code or '']] </para>
69 </td>
70 </tr>
71 <tr>
72 <td>
73 <para style="terp_default_Bold_9">Quantity</para>
74 </td>
75 <td>
76 <para style="terp_default_Bold_9">[[ move_lines.product_qty or '']]</para>
77 </td>
78 </tr>
79 <tr>
80 <td>
81 <para style="terp_default_Bold_9">Pack</para>
82 </td>
83 <td>
84 <para style="terp_default_Bold_9">[[picking.name]]</para>
85 </td>
86 </tr>
87 <tr>
88 <td>
89 <barCode code="code128" barWidth="1.4" barHeight="25">[[picking.name or removeParentNode('td')]]</barCode>
90 </td>
91 <td>
92 </td>
93 </tr>
94 <tr>
95 <td>
96 <para style="terp_default_Bold_9">EAN</para>
97 </td>
98 <td>
99 <para style="terp_default_Bold_9">[[ move_lines.product_packaging.ean or '']]</para>
100 </td>
101 </tr>
102 <tr>
103 <td>
104 <barCode code="code128" barWidth="1.4" barHeight="25">[[move_lines.product_packaging.ean or removeParentNode('td')]]</barCode>
105 </td>
106 <td>
107 </td>
108 </tr>
109 <tr>
110 <td>
111 <para style="terp_default_Bold_9">Production Lot</para>
112 </td>
113 <td>
114 <para style="terp_default_Bold_9">[[ move_lines.prodlot_id.name or '']]</para>
115 </td>
116 </tr>
117 <tr>
118 <td>
119 <barCode code="code128" barWidth="1.4" barHeight="25">[[move_lines.prodlot_id.name or removeParentNode('td')]]</barCode>
120 </td>
121 <td>
122 </td>
123 </tr>
124 </blockTable>
125 </section>
126 </story>
127</document>
0128
=== modified file 'packing_barcode_check/wizard/scan_product.py'
--- packing_barcode_check/wizard/scan_product.py 2010-06-23 14:49:06 +0000
+++ packing_barcode_check/wizard/scan_product.py 2010-06-24 12:22:25 +0000
@@ -47,11 +47,13 @@
47 move_data = stock_move_obj.browse(cr, uid,move_id)47 move_data = stock_move_obj.browse(cr, uid,move_id)
48 if move_data.product_qty == move_data.scaned_qty:48 if move_data.product_qty == move_data.scaned_qty:
49 continue49 continue
50 product_ean = move_data.product_id.ean1350 for ean_id in move_data.product_id.packaging:
51 51 ean_data = pool.get("product.packaging").browse(cr, uid, ean_id.id)
52 if product_ean == form_ean:52 product_ean = ean_data.ean
53 EAN_Found = True53 if product_ean == form_ean:
54 return 'scan_product_number'54 EAN_Found = True
55 return 'scan_product_number'
56
55 if not EAN_Found:57 if not EAN_Found:
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.'))
57 return {}59 return {}

Subscribers

People subscribed via source and target branches