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

Proposed by Atik Agewan(OpenERP)
Status: Merged
Merged at revision: 40
Proposed branch: lp:~openbig/bigconsulting/again_modify_product_ean13_generator_last
Merge into: lp:bigconsulting
Diff against target: 253 lines (+131/-57)
3 files modified
product_ean13_generator/__terp__.py (+1/-1)
product_ean13_generator/report/product_ean_generator_report.rml (+117/-43)
product_ean13_generator/wizard/generator_ean13.py (+13/-13)
To merge this branch: bzr merge lp:~openbig/bigconsulting/again_modify_product_ean13_generator_last
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+28975@code.launchpad.net

Description of the change

again_modify_product_ean13_generator_last is done

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 'product_ean13_generator/__terp__.py'
--- product_ean13_generator/__terp__.py 2010-06-24 10:49:42 +0000
+++ product_ean13_generator/__terp__.py 2010-07-01 10:41:12 +0000
@@ -29,7 +29,7 @@
29 "description": """29 "description": """
30 * Adds a wizard on product form to generate valid EAN13 product codes.30 * Adds a wizard on product form to generate valid EAN13 product codes.
31 * By default EAN13 will be generated with german country code (404) and 13341 as company code.31 * By default EAN13 will be generated with german country code (404) and 13341 as company code.
32 Each company should this values on administration/sequences to addecuate to his country and company code.32 Each company should change these values on administration/sequences to their country's and company's code.
33 """,33 """,
34 "license" : "GPL-3",34 "license" : "GPL-3",
35 "depends" : ["base","product",],35 "depends" : ["base","product",],
3636
=== modified file 'product_ean13_generator/report/product_ean_generator_report.rml'
--- product_ean13_generator/report/product_ean_generator_report.rml 2010-06-03 06:48:10 +0000
+++ product_ean13_generator/report/product_ean_generator_report.rml 2010-07-01 10:41:12 +0000
@@ -14,33 +14,34 @@
14 <blockAlignment value="LEFT"/>14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>15 <blockValign value="TOP"/>
16 <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>16 <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
17 <lineStyle kind="LINEAFTER" colorName="#000000" start="0,0" stop="0,-1"/>
17 <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>18 <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
18 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>19 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
19 <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
20 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
21 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
22 <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
23 <lineStyle kind="LINEAFTER" colorName="#000000" start="2,0" stop="2,-1"/>
24 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
25 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
26 <blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
27 <blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
28 <blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
29 </blockTableStyle>20 </blockTableStyle>
30 <blockTableStyle id="Table2">21 <blockTableStyle id="Table3">
31 <blockAlignment value="LEFT"/>22 <blockAlignment value="LEFT"/>
32 <blockValign value="TOP"/>23 <blockValign value="TOP"/>
33 <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>24 <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
34 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>25 <lineStyle kind="LINEAFTER" colorName="#000000" start="0,0" stop="0,-1"/>
35 <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>26 <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
36 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>27 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
37 <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>28 <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,1" stop="0,-1"/>
38 <lineStyle kind="LINEAFTER" colorName="#000000" start="2,0" stop="2,-1"/>29 <lineStyle kind="LINEAFTER" colorName="#000000" start="0,1" stop="0,-1"/>
39 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>30 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
40 </blockTableStyle>31 </blockTableStyle>
41 <initialize>32 <initialize>
42 <paraStyle name="all" alignment="justify"/>33 <paraStyle name="all" alignment="justify"/>
43 </initialize>34 </initialize>
35 <paraStyle name="P1" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="CENTER"/>
36 <paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER"/>
37 <paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT"/>
38 <paraStyle name="P4" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="CENTER"/>
39 <paraStyle name="P5" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
40 <paraStyle name="P6" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
41 <paraStyle name="P7" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
42 <paraStyle name="P8" fontName="Times-Roman" fontSize="10.0" leading="13"/>
43 <paraStyle name="P9" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="LEFT"/>
44 <paraStyle name="P10" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT"/>
44 <paraStyle name="Standard" fontName="Times-Roman"/>45 <paraStyle name="Standard" fontName="Times-Roman"/>
45 <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>46 <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
46 <paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>47 <paraStyle name="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
@@ -79,43 +80,116 @@
79 <images/>80 <images/>
80 </stylesheet>81 </stylesheet>
81 <story>82 <story>
83 <para style="P7">
84 <font color="white"> .........</font>
85 <font color="white"> .........</font>
86 <font face="Times-Roman" size="15.0"/>
87 <font face="Times-Bold" size="15.0">EAN13 REPORT</font>
88 </para>
82 <para style="terp_default_8">89 <para style="terp_default_8">
83 <font color="white"> </font>90 <font face="Times-Bold" size="10.0"/>
84 </para>91 <font face="Times-Roman" size="10.0">[[repeatIn(objects,'o')]]</font>
85 <para style="Standard">92 </para>
86 <font color="white"> </font>93 <para style="P8">
87 </para>94 <font color="white"> </font>
88 <blockTable colWidths="78.0,294.0,167.0" style="Table1">95 </para>
96 <blockTable colWidths="228.0" style="Table1">
89 <tr>97 <tr>
90 <td>98 <td>
91 <para style="terp_default_Bold_12">Code</para>99 <para style="P9">Code : <font face="Times-Roman">[[ o.code ]]</font></para>
92 </td>100 <para style="P9">Name : <font face="Times-Roman">[[ o.name ]]</font></para>
93 <td>101 <para style="P9">Ean Number:</para>
94 <para style="terp_default_Bold_12">Name</para>
95 </td>
96 <td>
97 <para style="terp_default_Bold_12">EAN 13 Code</para>
98 </td>102 </td>
99 </tr>103 </tr>
100 </blockTable>104 </blockTable>
101 <section>105 <section>
106 <para style="P1">[[repeatIn(o.packaging,'a')]]</para>
107 <blockTable colWidths="228.0" style="Table3">
108 <tr>
109 <td>
110 <para style="P3">[[ a.ean ]]</para>
111 </td>
112 </tr>
113 <tr>
114 <td>
115 <barCode code="code128" barWidth="1.4" barHeight="25">[[ a.ean or removeParentNode('td')]]</barCode>
116 </td>
117 </tr>
118 </blockTable>
119 </section>
120 <para style="P5">
121 <font color="white"> </font>
122 </para>
123 <para style="P5">
124 <font color="white"> </font>
125 </para>
126 <para style="P5">
127 <font color="white"> </font>
128 </para>
129 <section>
130 <para style="P6">
131 <font color="white"> </font>
132 </para>
133 </section>
134 <para style="P6">
135 <font color="white"> </font>
136 </para>
137 <para style="P1">
138 <font color="white"> </font>
139 </para>
140 <para style="P1">
141 <font color="white"> </font>
142 </para>
143 <para style="P1">
144 <font color="white"> </font>
145 </para>
146 <para style="P1">
147 <font color="white"> </font>
148 </para>
149 <para style="P1">
150 <font color="white"> </font>
151 </para>
152 <para style="P1">
153 <font color="white"> </font>
154 </para>
155 <para style="P1">
156 <font color="white"> </font>
157 </para>
158 <para style="P6">
159 <font color="white"> </font>
160 </para>
161 <para style="P6">
162 <font color="white"> </font>
163 </para>
164 <para style="P6">
165 <font color="white"> </font>
166 </para>
167 <para style="P6">
168 <font color="white"> </font>
169 </para>
170 <para style="P6">
171 <font color="white"> </font>
172 </para>
173 <para style="P6">
174 <font color="white"> </font>
175 </para>
176 <para style="Standard">
177 <font color="white"> </font>
178 </para>
179 <para style="Standard">
180 <font color="white"> </font>
181 </para>
182 <section>
102 <para style="terp_default_1">[[repeatIn(objects,'o')]]</para>183 <para style="terp_default_1">[[repeatIn(objects,'o')]]</para>
103 <blockTable colWidths="78.0,294.0,167.0" style="Table2">184 <para style="terp_default_1">
104 <tr>185 <font color="white"> </font>
105 <td>186 </para>
106 <para style="terp_default_left_10">[[ o.code ]]</para>
107 </td>
108 <td>
109 <para style="terp_default_left_10">[[ o.name ]]</para>
110 </td>
111 <td>
112 <para style="terp_default_left_10">[[ o.ean13 ]]</para>
113 </td>
114 </tr>
115 </blockTable>
116 </section>187 </section>
117 <para style="Standard">188 <para style="Standard">
118 <font color="white"> </font>189 <font color="white"> </font>
119 </para>190 </para>
191 <para style="Standard">
192 <font color="white"> </font>
193 </para>
120 </story>194 </story>
121</document>195</document>
122196
=== modified file 'product_ean13_generator/report/product_ean_generator_report.sxw'
123Binary files product_ean13_generator/report/product_ean_generator_report.sxw 2010-06-03 06:48:10 +0000 and product_ean13_generator/report/product_ean_generator_report.sxw 2010-07-01 10:41:12 +0000 differ197Binary files product_ean13_generator/report/product_ean_generator_report.sxw 2010-06-03 06:48:10 +0000 and product_ean13_generator/report/product_ean_generator_report.sxw 2010-07-01 10:41:12 +0000 differ
=== modified file 'product_ean13_generator/wizard/generator_ean13.py'
--- product_ean13_generator/wizard/generator_ean13.py 2010-06-29 06:24:04 +0000
+++ product_ean13_generator/wizard/generator_ean13.py 2010-07-01 10:41:12 +0000
@@ -40,22 +40,22 @@
40 product_obj = pooler.get_pool(cr.dbname).get('product.product')40 product_obj = pooler.get_pool(cr.dbname).get('product.product')
41 sequence_obj = pooler.get_pool(cr.dbname).get('ir.sequence')41 sequence_obj = pooler.get_pool(cr.dbname).get('ir.sequence')
42 packaging_obj = pooler.get_pool(cr.dbname).get('product.packaging')42 packaging_obj = pooler.get_pool(cr.dbname).get('product.packaging')
43
44 for product in product_obj.browse(cr, uid, data['ids'], context=context):43 for product in product_obj.browse(cr, uid, data['ids'], context=context):
45 ref = sequence_obj.get(cr, uid, 'generator.ean13')44 ref = sequence_obj.get(cr, uid, 'generator.ean13')
46 for pack in product.packaging:45 for pack in product.packaging:
47 ref = sequence_obj.get(cr, uid, 'generator.ean13')46 ean_val = pack.ean
48 sum=047 if ean_val == False:
49 for i in range(12):48 ref = sequence_obj.get(cr, uid, 'generator.ean13')
50 if is_pair(i):49 sum=0
51 sum += int(ref[i])50 for i in range(12):
52 else:51 if is_pair(i):
53 sum += 3 * int(ref[i])52 sum += int(ref[i])
54 new_ean_cc = int(math.ceil(sum / 10.0) * 10 - sum)53 else:
55 new_ean = ref + str(new_ean_cc)54 sum += 3 * int(ref[i])
56 vals = {'ean': new_ean}55 new_ean_cc = int(math.ceil(sum / 10.0) * 10 - sum)
57 packaging_obj.write(cr, uid, [pack.id], vals)56 new_ean = ref + str(new_ean_cc)
5857 vals = {'ean': new_ean}
58 packaging_obj.write(cr, uid, [pack.id], vals)
59 return {}59 return {}
6060
61class generate_ean13(wizard.interface):61class generate_ean13(wizard.interface):

Subscribers

People subscribed via source and target branches