Merge lp:~agilebg/openerp-mrp-reports/adding_mrp_webkit into lp:~openerp-community-reviewer/openerp-mrp-reports/7.0
- adding_mrp_webkit
- Merge into 7.0
Status: | Rejected |
---|---|
Rejected by: | Yannick Vaucher @ Camptocamp |
Proposed branch: | lp:~agilebg/openerp-mrp-reports/adding_mrp_webkit |
Merge into: | lp:~openerp-community-reviewer/openerp-mrp-reports/7.0 |
Diff against target: |
638 lines (+597/-0) 7 files modified
mrp_webkit/__init__.py (+23/-0) mrp_webkit/__openerp__.py (+47/-0) mrp_webkit/mrp_report.xml (+330/-0) mrp_webkit/report/__init__.py (+24/-0) mrp_webkit/report/bom_structure.mako (+66/-0) mrp_webkit/report/bom_structure.py (+68/-0) mrp_webkit/report/order.py (+39/-0) |
To merge this branch: | bzr merge lp:~agilebg/openerp-mrp-reports/adding_mrp_webkit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandre Fayolle - camptocamp | Disapprove | ||
Lorenzo Battistini (community) | Needs Fixing | ||
Review via email: mp+207471@code.launchpad.net |
Commit message
Description of the change
Hi,
I've made this Merge Proposal to add mrp_webkit in this branch such as is written here https:/
Nicola Malcontenti - Agile BG (hurrin1c0) wrote : | # |
> Ciao Nico
>
> you should remove mrp_webkit/
> and run a PEP8 validator
>
> When importing Python modules from the same addon, use explicit relative
> import rather than absolute import, example in __init__.py, do not use:
> import sale
> But
> from . import sale
>
> line 552: osv is not used
fixed
Lorenzo Battistini (elbati) wrote : | # |
line 418: added file 'mrp_webkit/
line 594: there's something wrong with symlink
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
I did the MP again, using bazaar extractor to preserve the original authors.
Lorenzo Battistini (elbati) wrote : | # |
On 03/03/2014 11:58 AM, Alexandre Fayolle - camptocamp wrote:
> Review: Disapprove
>
> I did the MP again, using bazaar extractor to preserve the original authors.
Thanks Alexandre.
Here is the link
https:/
<https:/
Preview Diff
1 | === added directory 'mrp_webkit' | |||
2 | === added file 'mrp_webkit/__init__.py' | |||
3 | --- mrp_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ mrp_webkit/__init__.py 2014-02-26 09:55:33 +0000 | |||
5 | @@ -0,0 +1,23 @@ | |||
6 | 1 | # -*- coding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services | ||
11 | 6 | # (<http://www.serpentcs.com>) | ||
12 | 7 | # | ||
13 | 8 | # This program is free software: you can redistribute it and/or modify | ||
14 | 9 | # it under the terms of the GNU Affero General Public License as | ||
15 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
16 | 11 | # License, or (at your option) any later version. | ||
17 | 12 | # | ||
18 | 13 | # This program is distributed in the hope that it will be useful, | ||
19 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | 16 | # GNU Affero General Public License for more details. | ||
22 | 17 | # | ||
23 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
24 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | 20 | # | ||
26 | 21 | ############################################################################ | ||
27 | 22 | |||
28 | 23 | from . import report | ||
29 | 0 | 24 | ||
30 | === added file 'mrp_webkit/__openerp__.py' | |||
31 | --- mrp_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
32 | +++ mrp_webkit/__openerp__.py 2014-02-26 09:55:33 +0000 | |||
33 | @@ -0,0 +1,47 @@ | |||
34 | 1 | # -*- coding: utf-8 -*- | ||
35 | 2 | ############################################################################## | ||
36 | 3 | # | ||
37 | 4 | # OpenERP, Open Source Management Solution | ||
38 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services Pvt. | ||
39 | 6 | # Ltd.(<http://www.serpentcs.com>) | ||
40 | 7 | # | ||
41 | 8 | # This program is free software: you can redistribute it and/or modify | ||
42 | 9 | # it under the terms of the GNU Affero General Public License as | ||
43 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
44 | 11 | # License, or (at your option) any later version. | ||
45 | 12 | # | ||
46 | 13 | # This program is distributed in the hope that it will be useful, | ||
47 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
48 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
49 | 16 | # GNU Affero General Public License for more details. | ||
50 | 17 | # | ||
51 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
52 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
53 | 20 | # | ||
54 | 21 | ############################################################################ | ||
55 | 22 | |||
56 | 23 | |||
57 | 24 | { | ||
58 | 25 | 'name': 'MRP', | ||
59 | 26 | 'version': '1.0', | ||
60 | 27 | 'author': 'Serpent Consulting Services Pvt. Ltd.', | ||
61 | 28 | 'website': 'http://www.serpentcs.com', | ||
62 | 29 | 'category': 'Manufacturing', | ||
63 | 30 | 'sequence': 18, | ||
64 | 31 | 'summary': 'Manufacturing Orders, Bill of Materials, Routing', | ||
65 | 32 | 'depends': ['mrp', 'report_webkit'], | ||
66 | 33 | 'description': """ | ||
67 | 34 | Manage the Manufacturing process in OpenERP | ||
68 | 35 | =========================================== | ||
69 | 36 | |||
70 | 37 | It is conversion of rml report to Webkit Report. | ||
71 | 38 | |||
72 | 39 | """, | ||
73 | 40 | 'data': [ | ||
74 | 41 | 'mrp_report.xml', | ||
75 | 42 | ], | ||
76 | 43 | 'installable': True, | ||
77 | 44 | 'application': True, | ||
78 | 45 | 'auto_install': False, | ||
79 | 46 | } | ||
80 | 47 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
81 | 0 | 48 | ||
82 | === added file 'mrp_webkit/mrp_report.xml' | |||
83 | --- mrp_webkit/mrp_report.xml 1970-01-01 00:00:00 +0000 | |||
84 | +++ mrp_webkit/mrp_report.xml 2014-02-26 09:55:33 +0000 | |||
85 | @@ -0,0 +1,330 @@ | |||
86 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
87 | 2 | <openerp> | ||
88 | 3 | <data> | ||
89 | 4 | <record id="bom webkit header" model="ir.header_webkit"> | ||
90 | 5 | <field name="footer_html"><![CDATA[]]></field> | ||
91 | 6 | <field name="orientation">Portrait</field> | ||
92 | 7 | <field name="format">A4</field> | ||
93 | 8 | <field name="html"><![CDATA[ | ||
94 | 9 | <html> | ||
95 | 10 | <head> | ||
96 | 11 | |||
97 | 12 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
98 | 13 | <script> | ||
99 | 14 | function subst() { | ||
100 | 15 | var vars={}; | ||
101 | 16 | var x=document.location.search.substring(1).split('&'); | ||
102 | 17 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
103 | 18 | if(vars['page']!=1){ | ||
104 | 19 | document.getElementById('inner_head').innerHTML=document.getElementById('actual_header').innerHTML; | ||
105 | 20 | } | ||
106 | 21 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
107 | 22 | for(var i in x) { | ||
108 | 23 | var y = document.getElementsByClassName(x[i]); | ||
109 | 24 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
110 | 25 | } | ||
111 | 26 | } | ||
112 | 27 | </script> | ||
113 | 28 | <style type="text/css"> | ||
114 | 29 | ${css} | ||
115 | 30 | </style> | ||
116 | 31 | </head> | ||
117 | 32 | <body style="border:0; margin:0;" onload="subst()"> | ||
118 | 33 | <table style="border:0" width="100%"> | ||
119 | 34 | <tr> | ||
120 | 35 | <td width="92%"> | ||
121 | 36 | <td width="4%" style="text-align:right;font-size:10;width:350px;"> <span class="page"/></td> | ||
122 | 37 | <td width="4%" style="text-align:left;font-size:10;width:30px"> / <span class="topage"/></td> | ||
123 | 38 | </tr> | ||
124 | 39 | </table> ${_debug or ''|n} | ||
125 | 40 | <table id="inner_head" style="width: 100%;margin-left:1%;margin-right:1%;" > | ||
126 | 41 | |||
127 | 42 | </table>${_debug or ''|n} | ||
128 | 43 | <table id="actual_header" style="display:none;margin-left:5%;" class="basic_table"> | ||
129 | 44 | <tr > | ||
130 | 45 | <td style="text-align:left; border-color:black;border-bottom:2px solid black; font-size:14; font-family: Helvetica-Bold;" width="35%"><b>${ _('BOM Name') }</b></td> | ||
131 | 46 | <td style="text-align:left;border-color:black;border-bottom:2px solid black; font-size:14; font-family: Helvetica-Bold;" width="35%"><b>${ _('Product Name') }</b></td> | ||
132 | 47 | <td style="text-align:right;border-color:black;border-bottom:2px solid black; font-size:14; font-family: Helvetica-Bold;" width="15%"><b>${ _('Quantity') }<b></td> | ||
133 | 48 | <td style="text-align:center;border-color:black;border-bottom:2px solid black; font-size:14; font-family: Helvetica-Bold;" width="15%"><b>${ _('BOM Ref') }</b></td> | ||
134 | 49 | </tr> | ||
135 | 50 | </table> | ||
136 | 51 | </body> | ||
137 | 52 | </html>]]> | ||
138 | 53 | </field> | ||
139 | 54 | <field eval="15.0" name="margin_top"/> | ||
140 | 55 | <field eval="5.0" name="margin_bottom"/> | ||
141 | 56 | <field name="css"><![CDATA[ | ||
142 | 57 | |||
143 | 58 | |||
144 | 59 | |||
145 | 60 | |||
146 | 61 | .basic_table{ | ||
147 | 62 | border-color:black; | ||
148 | 63 | border-collapse: collapse; | ||
149 | 64 | font-family: Helvetica-Bold; | ||
150 | 65 | } | ||
151 | 66 | .basic_table td { | ||
152 | 67 | border-color:black; | ||
153 | 68 | border-bottom:2px solid black; | ||
154 | 69 | font-size:12px; | ||
155 | 70 | } | ||
156 | 71 | |||
157 | 72 | .list_table { | ||
158 | 73 | border-color:black; | ||
159 | 74 | border-collapse: collapse; | ||
160 | 75 | font-family: Helvetica; | ||
161 | 76 | } | ||
162 | 77 | .list_table td { | ||
163 | 78 | border-bottom:1px solid #ccc; | ||
164 | 79 | font-size:12px; | ||
165 | 80 | padding-left:3px | ||
166 | 81 | padding-right:3px | ||
167 | 82 | padding-top:3px | ||
168 | 83 | padding-bottom:3px | ||
169 | 84 | } | ||
170 | 85 | .list_table1 { | ||
171 | 86 | border-color:black; | ||
172 | 87 | border-collapse: collapse; | ||
173 | 88 | font-family: Helvetica; | ||
174 | 89 | } | ||
175 | 90 | .list_table1 td { | ||
176 | 91 | border-color:gray; | ||
177 | 92 | border-bottom:2px solid gray; | ||
178 | 93 | font-size:12px; | ||
179 | 94 | |||
180 | 95 | } | ||
181 | 96 | .list_table2 { | ||
182 | 97 | border-color:black; | ||
183 | 98 | border-collapse: collapse; | ||
184 | 99 | |||
185 | 100 | } | ||
186 | 101 | .list_table2 td { | ||
187 | 102 | border-color:black; | ||
188 | 103 | border-top:2px solid black; | ||
189 | 104 | border-bottom:2px solid black; | ||
190 | 105 | font-size:12; | ||
191 | 106 | padding-left:3px | ||
192 | 107 | padding-right:3px | ||
193 | 108 | padding-top:3px | ||
194 | 109 | padding-bottom:3px | ||
195 | 110 | } | ||
196 | 111 | .list_table th { | ||
197 | 112 | border-bottom:2px solid black; | ||
198 | 113 | text-align:left; | ||
199 | 114 | font-size:12px; | ||
200 | 115 | font-weight:bold; | ||
201 | 116 | padding-left:3px | ||
202 | 117 | padding-right:3px | ||
203 | 118 | } | ||
204 | 119 | |||
205 | 120 | .list_tabe thead { | ||
206 | 121 | display:table-header-group; | ||
207 | 122 | } | ||
208 | 123 | |||
209 | 124 | |||
210 | 125 | .total { | ||
211 | 126 | width:100%; | ||
212 | 127 | } | ||
213 | 128 | .lib { | ||
214 | 129 | width:10.3%; | ||
215 | 130 | } | ||
216 | 131 | .tot { | ||
217 | 132 | text-align:left; | ||
218 | 133 | width:15%; | ||
219 | 134 | } | ||
220 | 135 | .righttot { | ||
221 | 136 | width:74%; | ||
222 | 137 | } | ||
223 | 138 | .tax { | ||
224 | 139 | width:50%; | ||
225 | 140 | } | ||
226 | 141 | table { | ||
227 | 142 | display: table; | ||
228 | 143 | width: 100%; | ||
229 | 144 | } | ||
230 | 145 | |||
231 | 146 | table thead { | ||
232 | 147 | display: table-header-group; | ||
233 | 148 | } | ||
234 | 149 | |||
235 | 150 | table tbody { | ||
236 | 151 | display: table-row-group; | ||
237 | 152 | } | ||
238 | 153 | |||
239 | 154 | table tfoot { | ||
240 | 155 | display: table-footer-group; | ||
241 | 156 | } | ||
242 | 157 | |||
243 | 158 | table tr { | ||
244 | 159 | display: table-row; | ||
245 | 160 | height: auto; | ||
246 | 161 | } | ||
247 | 162 | |||
248 | 163 | table th, | ||
249 | 164 | table td { | ||
250 | 165 | display: table-cell; | ||
251 | 166 | overflow: visible; | ||
252 | 167 | } | ||
253 | 168 | |||
254 | 169 | table th, | ||
255 | 170 | table td { | ||
256 | 171 | height: 1px; /* Do the trick to make div.nobrk fill td height */ | ||
257 | 172 | } | ||
258 | 173 | |||
259 | 174 | table tr.singlecell td, | ||
260 | 175 | table tr.singlecell th { | ||
261 | 176 | height: auto; /* Reset trick for a full row td */ | ||
262 | 177 | } | ||
263 | 178 | |||
264 | 179 | .nobrk { | ||
265 | 180 | page-break-inside: avoid; | ||
266 | 181 | orphans: 10; | ||
267 | 182 | widows: 10; | ||
268 | 183 | position: relative; | ||
269 | 184 | margin: -1px 0 0 -1px; | ||
270 | 185 | min-height: 14px; | ||
271 | 186 | line-height: 14px; | ||
272 | 187 | height: 100%; | ||
273 | 188 | } | ||
274 | 189 | |||
275 | 190 | table tbody td .nobrk { | ||
276 | 191 | min-height: 5px; | ||
277 | 192 | } | ||
278 | 193 | ]]> | ||
279 | 194 | </field> | ||
280 | 195 | <field name="name">bom webkit header</field> | ||
281 | 196 | </record> | ||
282 | 197 | |||
283 | 198 | <record id="production webkit header" model="ir.header_webkit"> | ||
284 | 199 | <field name="footer_html"><![CDATA[]]></field> | ||
285 | 200 | <field name="orientation">Portrait</field> | ||
286 | 201 | <field name="format">A4</field> | ||
287 | 202 | <field name="html"><![CDATA[ | ||
288 | 203 | <html> | ||
289 | 204 | <head> | ||
290 | 205 | |||
291 | 206 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
292 | 207 | <script> | ||
293 | 208 | function subst() { | ||
294 | 209 | var vars={}; | ||
295 | 210 | var x=document.location.search.substring(1).split('&'); | ||
296 | 211 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
297 | 212 | if(vars['page']!=1){ | ||
298 | 213 | document.getElementById('inner_head').innerHTML=document.getElementById('actual_header').innerHTML; | ||
299 | 214 | } | ||
300 | 215 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
301 | 216 | for(var i in x) { | ||
302 | 217 | var y = document.getElementsByClassName(x[i]); | ||
303 | 218 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
304 | 219 | } | ||
305 | 220 | } | ||
306 | 221 | </script> | ||
307 | 222 | <style type="text/css"> | ||
308 | 223 | ${css} | ||
309 | 224 | </style> | ||
310 | 225 | </head> | ||
311 | 226 | <body style="border:0; margin:0;" onload="subst()"> | ||
312 | 227 | <table class="header" style="border-bottom: 1px solid black; width: 100%"> | ||
313 | 228 | <tr > | ||
314 | 229 | <td style="text-align:right;font-size:10;font-family: Helvetica-Bold;" width="15%">${ formatLang(time.strftime('%Y-%m-%d'),date=True)} ${time.strftime('%I:%M')}</td> | ||
315 | 230 | <td style="text-align:center;font-size:14; font-family: Helvetica-Bold;" width="75%"><b>${company.partner_id.name |entity}</b></td> | ||
316 | 231 | <td width="5%" style="text-align:right;font-size:10;width:350px; font-family: Helvetica-Bold;" > <span class="page"/></td> | ||
317 | 232 | <td width="5%" style="text-align:left;font-size:10;width:30px font-family: Helvetica-Bold;"> / <span class="topage"/></td> | ||
318 | 233 | </tr> | ||
319 | 234 | </table> ${_debug or ''|n} | ||
320 | 235 | <table id="inner_head" style="width: 100%;margin-left:1%;margin-right:1%;" > | ||
321 | 236 | |||
322 | 237 | </table>${_debug or ''|n} | ||
323 | 238 | <table id="actual_header" style="display:none;margin-left:5%;" class="basic_table"> | ||
324 | 239 | <tr > | ||
325 | 240 | |||
326 | 241 | </tr> | ||
327 | 242 | </table> | ||
328 | 243 | </body> | ||
329 | 244 | </html>]]> | ||
330 | 245 | </field> | ||
331 | 246 | <field eval="15.0" name="margin_top"/> | ||
332 | 247 | <field eval="5.0" name="margin_bottom"/> | ||
333 | 248 | <field name="css"><![CDATA[ | ||
334 | 249 | |||
335 | 250 | .basic_table{ | ||
336 | 251 | border-collapse: collapse; | ||
337 | 252 | font-family: Helvetica-Bold; | ||
338 | 253 | } | ||
339 | 254 | .basic_table td { | ||
340 | 255 | border-color:black; | ||
341 | 256 | border-bottom:2px solid black; | ||
342 | 257 | |||
343 | 258 | } | ||
344 | 259 | |||
345 | 260 | .title{ | ||
346 | 261 | text-align:left | ||
347 | 262 | font-family: Helvetica-Bold; | ||
348 | 263 | font-size:12px; | ||
349 | 264 | } | ||
350 | 265 | |||
351 | 266 | .list_table { | ||
352 | 267 | border-color:black; | ||
353 | 268 | border-collapse: collapse; | ||
354 | 269 | font-family: Helvetica; | ||
355 | 270 | } | ||
356 | 271 | .list_table td { | ||
357 | 272 | border-color:gray; | ||
358 | 273 | border-bottom:1px solid gray; | ||
359 | 274 | font-size:12px; | ||
360 | 275 | |||
361 | 276 | } | ||
362 | 277 | .list_table1 { | ||
363 | 278 | border-color:black; | ||
364 | 279 | border-collapse: collapse; | ||
365 | 280 | font-family: Helvetica; | ||
366 | 281 | font-size:12px; | ||
367 | 282 | } | ||
368 | 283 | .list_table1 td { | ||
369 | 284 | border-color:gray; | ||
370 | 285 | border-bottom:1px solid gray; | ||
371 | 286 | |||
372 | 287 | |||
373 | 288 | } | ||
374 | 289 | .list_table2 { | ||
375 | 290 | text-align:center; | ||
376 | 291 | border-collapse: collapse; | ||
377 | 292 | } | ||
378 | 293 | .list_table2 td { | ||
379 | 294 | border:1px solid lightGrey; | ||
380 | 295 | border-collapse: collapse; | ||
381 | 296 | font-family: Helvetica; | ||
382 | 297 | font-size:11px; | ||
383 | 298 | } | ||
384 | 299 | |||
385 | 300 | } | ||
386 | 301 | |||
387 | 302 | ]]> | ||
388 | 303 | </field> | ||
389 | 304 | <field name="name">production webkit header</field> | ||
390 | 305 | </record> | ||
391 | 306 | |||
392 | 307 | <report | ||
393 | 308 | auto="True" | ||
394 | 309 | header="False" | ||
395 | 310 | id="report_bom_structure" | ||
396 | 311 | model="mrp.bom" | ||
397 | 312 | name="bom.structure.webkit" | ||
398 | 313 | file="mrp_webkit/report/bom_structure.mako" | ||
399 | 314 | string="BOM Structure" | ||
400 | 315 | report_type="webkit" | ||
401 | 316 | webkit_header="bom webkit header"/> | ||
402 | 317 | |||
403 | 318 | <report | ||
404 | 319 | id="report_mrp_production_report" | ||
405 | 320 | string="Production Order" | ||
406 | 321 | model="mrp.production" | ||
407 | 322 | name="mrp.production.order.webkit" | ||
408 | 323 | file="mrp_webkit/report/order.mako" | ||
409 | 324 | auto="False" | ||
410 | 325 | report_type="webkit" | ||
411 | 326 | webkit_header="production webkit header" | ||
412 | 327 | /> | ||
413 | 328 | |||
414 | 329 | </data> | ||
415 | 330 | </openerp> | ||
416 | 0 | 331 | ||
417 | === added directory 'mrp_webkit/report' | |||
418 | === added file 'mrp_webkit/report/.DS_Store' | |||
419 | 1 | Binary files mrp_webkit/report/.DS_Store 1970-01-01 00:00:00 +0000 and mrp_webkit/report/.DS_Store 2014-02-26 09:55:33 +0000 differ | 332 | Binary files mrp_webkit/report/.DS_Store 1970-01-01 00:00:00 +0000 and mrp_webkit/report/.DS_Store 2014-02-26 09:55:33 +0000 differ |
420 | === added file 'mrp_webkit/report/__init__.py' | |||
421 | --- mrp_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
422 | +++ mrp_webkit/report/__init__.py 2014-02-26 09:55:33 +0000 | |||
423 | @@ -0,0 +1,24 @@ | |||
424 | 1 | # -*- coding: utf-8 -*- | ||
425 | 2 | ############################################################################## | ||
426 | 3 | # | ||
427 | 4 | # OpenERP, Open Source Management Solution | ||
428 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services | ||
429 | 6 | # (<http://www.serpentcs.com>) | ||
430 | 7 | # | ||
431 | 8 | # This program is free software: you can redistribute it and/or modify | ||
432 | 9 | # it under the terms of the GNU Affero General Public License as | ||
433 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
434 | 11 | # License, or (at your option) any later version. | ||
435 | 12 | # | ||
436 | 13 | # This program is distributed in the hope that it will be useful, | ||
437 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
438 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
439 | 16 | # GNU Affero General Public License for more details. | ||
440 | 17 | # | ||
441 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
442 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
443 | 20 | # | ||
444 | 21 | ############################################################################ | ||
445 | 22 | |||
446 | 23 | from . import order | ||
447 | 24 | from . import bom_structure | ||
448 | 0 | 25 | ||
449 | === added file 'mrp_webkit/report/bom_structure.mako' | |||
450 | --- mrp_webkit/report/bom_structure.mako 1970-01-01 00:00:00 +0000 | |||
451 | +++ mrp_webkit/report/bom_structure.mako 2014-02-26 09:55:33 +0000 | |||
452 | @@ -0,0 +1,66 @@ | |||
453 | 1 | <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
454 | 2 | |||
455 | 3 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
456 | 4 | <head> | ||
457 | 5 | <style type="text/css"> | ||
458 | 6 | ${css} | ||
459 | 7 | </style> | ||
460 | 8 | <title>BOM Structure.pdf</title> | ||
461 | 9 | </head> | ||
462 | 10 | <body> | ||
463 | 11 | <table width="100%"> | ||
464 | 12 | <tr> | ||
465 | 13 | <td style="text-align:center;"> | ||
466 | 14 | <h2><b>${ _('BOM Structure') } </b></h2> | ||
467 | 15 | </td> | ||
468 | 16 | </tr> | ||
469 | 17 | </table> | ||
470 | 18 | |||
471 | 19 | <table width="100%" class="basic_table"> | ||
472 | 20 | <tr > | ||
473 | 21 | <td style="text-align:left;" width="35%"><b>${ _('BOM Name') }</b></td> | ||
474 | 22 | <td style="text-align:left;" width="35%"><b>${ _('Product Name') }</b></td> | ||
475 | 23 | <td style="text-align:right;" width="15%"><b>${ _('Quantity') }<b></td> | ||
476 | 24 | <td style="text-align:center;" width="15%"><b>${ _('BOM Ref') }</b></td> | ||
477 | 25 | </tr> | ||
478 | 26 | </table> | ||
479 | 27 | %for o in objects: | ||
480 | 28 | <table width="100%" class="list_table1"> | ||
481 | 29 | <tr > | ||
482 | 30 | <td style="text-align:left;" width="35%"><b> | ||
483 | 31 | ${o.name}</b> | ||
484 | 32 | </td> | ||
485 | 33 | <td style="text-align:left;" width="35%"><b> | ||
486 | 34 | [ ${(o.product_id.default_code) or removeParentNode('font')}] ${o.product_id.name}</b> | ||
487 | 35 | </td> | ||
488 | 36 | <td style="text-align:right;" width="15%"><b> | ||
489 | 37 | ${o.product_qty} ${o.product_uom.name}</b> | ||
490 | 38 | </td> | ||
491 | 39 | <td style="text-align:center;" width="15%"><b> | ||
492 | 40 | ${o.code or ''}</b> | ||
493 | 41 | </td><br/> | ||
494 | 42 | </tr> | ||
495 | 43 | </table> | ||
496 | 44 | |||
497 | 45 | %for l in get_children(o.bom_lines): | ||
498 | 46 | <table width="100%" class="list_table"> | ||
499 | 47 | <tr> | ||
500 | 48 | <td style="text-align:left ; padding-left:10px" width="35%" class="cell_extended_gray"> | ||
501 | 49 | <font color="white" >${'... '*(l['level'])}</font> - ${l['name']} | ||
502 | 50 | </td> | ||
503 | 51 | <td style="text-align:left;" width="35%" class="cell_extended_gray"> | ||
504 | 52 | ${ (l['pcode']) or '' } ${l['pname']} | ||
505 | 53 | </td> | ||
506 | 54 | <td style="text-align:right;" width="15%" class="cell_extended_gray"> | ||
507 | 55 | ${l['pqty']} ${l['uname']} | ||
508 | 56 | </td> | ||
509 | 57 | <td style="text-align:center;" width="15%" class="cell_extended_gray"> | ||
510 | 58 | ${l['code'] or ''} | ||
511 | 59 | </td> | ||
512 | 60 | </tr> | ||
513 | 61 | </table> | ||
514 | 62 | %endfor | ||
515 | 63 | </br> | ||
516 | 64 | %endfor | ||
517 | 65 | </body> | ||
518 | 66 | </html> | ||
519 | 0 | \ No newline at end of file | 67 | \ No newline at end of file |
520 | 1 | 68 | ||
521 | === added file 'mrp_webkit/report/bom_structure.py' | |||
522 | --- mrp_webkit/report/bom_structure.py 1970-01-01 00:00:00 +0000 | |||
523 | +++ mrp_webkit/report/bom_structure.py 2014-02-26 09:55:33 +0000 | |||
524 | @@ -0,0 +1,68 @@ | |||
525 | 1 | # -*- coding: utf-8 -*- | ||
526 | 2 | ############################################################################## | ||
527 | 3 | # | ||
528 | 4 | # OpenERP, Open Source Management Solution | ||
529 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services | ||
530 | 6 | # (<http://www.serpentcs.com>) | ||
531 | 7 | # | ||
532 | 8 | # This program is free software: you can redistribute it and/or modify | ||
533 | 9 | # it under the terms of the GNU Affero General Public License as | ||
534 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
535 | 11 | # License, or (at your option) any later version. | ||
536 | 12 | # | ||
537 | 13 | # This program is distributed in the hope that it will be useful, | ||
538 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
539 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
540 | 16 | # GNU Affero General Public License for more details. | ||
541 | 17 | # | ||
542 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
543 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
544 | 20 | # | ||
545 | 21 | ############################################################################ | ||
546 | 22 | |||
547 | 23 | import time | ||
548 | 24 | from openerp.report import report_sxw | ||
549 | 25 | from openerp.osv import osv | ||
550 | 26 | from openerp import pooler | ||
551 | 27 | |||
552 | 28 | |||
553 | 29 | class bom_structure(report_sxw.rml_parse): | ||
554 | 30 | def __init__(self, cr, uid, name, context): | ||
555 | 31 | super(bom_structure, self).__init__(cr, uid, name, context=context) | ||
556 | 32 | self.localcontext.update({ | ||
557 | 33 | 'time': time, | ||
558 | 34 | 'get_children': self.get_children, | ||
559 | 35 | }) | ||
560 | 36 | |||
561 | 37 | def get_children(self, object, level=0): | ||
562 | 38 | result = [] | ||
563 | 39 | |||
564 | 40 | def _get_rec(object, level): | ||
565 | 41 | for l in object: | ||
566 | 42 | res = {} | ||
567 | 43 | res['name'] = l.name | ||
568 | 44 | res['pname'] = l.product_id.name | ||
569 | 45 | res['pcode'] = l.product_id.default_code | ||
570 | 46 | res['pqty'] = l.product_qty | ||
571 | 47 | res['uname'] = l.product_uom.name | ||
572 | 48 | res['code'] = l.code | ||
573 | 49 | res['level'] = level | ||
574 | 50 | result.append(res) | ||
575 | 51 | if l.child_complete_ids: | ||
576 | 52 | if level < 6: | ||
577 | 53 | level += 1 | ||
578 | 54 | _get_rec(l.child_complete_ids, level) | ||
579 | 55 | if level > 0 and level < 6: | ||
580 | 56 | level -= 1 | ||
581 | 57 | return result | ||
582 | 58 | |||
583 | 59 | children = _get_rec(object, level) | ||
584 | 60 | |||
585 | 61 | return children | ||
586 | 62 | |||
587 | 63 | report_sxw.report_sxw( | ||
588 | 64 | 'report.bom.structure.webkit', | ||
589 | 65 | 'mrp.bom', | ||
590 | 66 | 'mrp_webkit/report/bom_structure.mako', | ||
591 | 67 | parser=bom_structure, | ||
592 | 68 | header='internal') | ||
593 | 0 | 69 | ||
594 | === added symlink 'mrp_webkit/report/order.mako' | |||
595 | === target is u'../../../../src/mako/mrp_order.mako' | |||
596 | === added file 'mrp_webkit/report/order.py' | |||
597 | --- mrp_webkit/report/order.py 1970-01-01 00:00:00 +0000 | |||
598 | +++ mrp_webkit/report/order.py 2014-02-26 09:55:33 +0000 | |||
599 | @@ -0,0 +1,39 @@ | |||
600 | 1 | # -*- coding: utf-8 -*- | ||
601 | 2 | ############################################################################## | ||
602 | 3 | # | ||
603 | 4 | # OpenERP, Open Source Management Solution | ||
604 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services | ||
605 | 6 | # (<http://www.serpentcs.com>) | ||
606 | 7 | # | ||
607 | 8 | # This program is free software: you can redistribute it and/or modify | ||
608 | 9 | # it under the terms of the GNU Affero General Public License as | ||
609 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
610 | 11 | # License, or (at your option) any later version. | ||
611 | 12 | # | ||
612 | 13 | # This program is distributed in the hope that it will be useful, | ||
613 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
614 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
615 | 16 | # GNU Affero General Public License for more details. | ||
616 | 17 | # | ||
617 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
618 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
619 | 20 | # | ||
620 | 21 | ############################################################################ | ||
621 | 22 | |||
622 | 23 | import time | ||
623 | 24 | from openerp.report import report_sxw | ||
624 | 25 | |||
625 | 26 | |||
626 | 27 | class order(report_sxw.rml_parse): | ||
627 | 28 | def __init__(self, cr, uid, name, context): | ||
628 | 29 | super(order, self).__init__(cr, uid, name, context=context) | ||
629 | 30 | self.localcontext.update({ | ||
630 | 31 | 'time': time, | ||
631 | 32 | }) | ||
632 | 33 | |||
633 | 34 | report_sxw.report_sxw( | ||
634 | 35 | 'report.mrp.production.order.webkit', | ||
635 | 36 | 'mrp.production', | ||
636 | 37 | 'addons/mrp_webkit/report/order.mako', | ||
637 | 38 | parser=order, | ||
638 | 39 | header='internal') |
Ciao Nico
you should remove mrp_webkit/ .DS_Store
and run a PEP8 validator
When importing Python modules from the same addon, use explicit relative import rather than absolute import, example in __init__.py, do not use:
import sale
But
from . import sale
line 552: osv is not used