Merge lp:~camptocamp/openerp-mrp-reports/7.0-add_serpentcs_mrp_webkit-afe into lp:~openerp-community-reviewer/openerp-mrp-reports/7.0
- 7.0-add_serpentcs_mrp_webkit-afe
- Merge into 7.0
Proposed by
Alexandre Fayolle - camptocamp
Status: | Merged |
---|---|
Merged at revision: | 3 |
Proposed branch: | lp:~camptocamp/openerp-mrp-reports/7.0-add_serpentcs_mrp_webkit-afe |
Merge into: | lp:~openerp-community-reviewer/openerp-mrp-reports/7.0 |
Diff against target: |
858 lines (+817/-0) 8 files modified
mrp_webkit/__init__.py (+24/-0) mrp_webkit/__openerp__.py (+46/-0) mrp_webkit/mrp_report.xml (+330/-0) mrp_webkit/report/__init__.py (+26/-0) mrp_webkit/report/bom_structure.mako (+66/-0) mrp_webkit/report/bom_structure.py (+66/-0) mrp_webkit/report/order.mako (+220/-0) mrp_webkit/report/order.py (+39/-0) |
To merge this branch: | bzr merge lp:~camptocamp/openerp-mrp-reports/7.0-add_serpentcs_mrp_webkit-afe |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guewen Baconnier @ Camptocamp | Approve | ||
Alex Comba - Agile BG (community) | code review, no test | Approve | |
Lorenzo Battistini (community) | code review | Approve | |
Review via email: mp+209039@code.launchpad.net |
Commit message
Description of the change
Extraction of mrp_report from lp:~serpentcs/openobject-addons/7.0-webkit-reports for inclusion in OCA
To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) : | # |
review:
Approve
(code review)
Revision history for this message
Alex Comba - Agile BG (tafaru) : | # |
review:
Approve
(code review, no test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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-03-03 11:00:02 +0000 | |||
5 | @@ -0,0 +1,24 @@ | |||
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 (<http://www.serpentcs.com>) | ||
11 | 6 | # | ||
12 | 7 | # This program is free software: you can redistribute it and/or modify | ||
13 | 8 | # it under the terms of the GNU Affero General Public License as | ||
14 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
15 | 10 | # License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU Affero General Public License for more details. | ||
21 | 16 | # | ||
22 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
23 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 19 | # | ||
25 | 20 | ############################################################################ | ||
26 | 21 | |||
27 | 22 | from . import report | ||
28 | 23 | |||
29 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
30 | 0 | 25 | ||
31 | === added file 'mrp_webkit/__openerp__.py' | |||
32 | --- mrp_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
33 | +++ mrp_webkit/__openerp__.py 2014-03-03 11:00:02 +0000 | |||
34 | @@ -0,0 +1,46 @@ | |||
35 | 1 | # -*- coding: utf-8 -*- | ||
36 | 2 | ############################################################################## | ||
37 | 3 | # | ||
38 | 4 | # OpenERP, Open Source Management Solution | ||
39 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services Pvt. Ltd.(<http://www.serpentcs.com>) | ||
40 | 6 | # | ||
41 | 7 | # This program is free software: you can redistribute it and/or modify | ||
42 | 8 | # it under the terms of the GNU Affero General Public License as | ||
43 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
44 | 10 | # License, or (at your option) any later version. | ||
45 | 11 | # | ||
46 | 12 | # This program is distributed in the hope that it will be useful, | ||
47 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
48 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
49 | 15 | # GNU Affero General Public License for more details. | ||
50 | 16 | # | ||
51 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
52 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
53 | 19 | # | ||
54 | 20 | ############################################################################ | ||
55 | 21 | |||
56 | 22 | |||
57 | 23 | { | ||
58 | 24 | 'name': 'MRP', | ||
59 | 25 | 'version': '1.0', | ||
60 | 26 | 'author': 'Serpent Consulting Services Pvt. Ltd.', | ||
61 | 27 | 'website': 'http://www.serpentcs.com', | ||
62 | 28 | 'category': 'Manufacturing', | ||
63 | 29 | 'sequence': 18, | ||
64 | 30 | 'summary': 'Manufacturing Orders, Bill of Materials, Routing', | ||
65 | 31 | 'depends': ['mrp','report_webkit'], | ||
66 | 32 | 'description': """ | ||
67 | 33 | Manage the Manufacturing process in OpenERP | ||
68 | 34 | =========================================== | ||
69 | 35 | |||
70 | 36 | It is conversion of rml report to Webkit Report. | ||
71 | 37 | |||
72 | 38 | """, | ||
73 | 39 | 'data': [ | ||
74 | 40 | 'mrp_report.xml', | ||
75 | 41 | ], | ||
76 | 42 | 'installable': True, | ||
77 | 43 | 'application': True, | ||
78 | 44 | 'auto_install': False, | ||
79 | 45 | } | ||
80 | 46 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
81 | 0 | 47 | ||
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-03-03 11:00:02 +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/__init__.py' | |||
419 | --- mrp_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
420 | +++ mrp_webkit/report/__init__.py 2014-03-03 11:00:02 +0000 | |||
421 | @@ -0,0 +1,26 @@ | |||
422 | 1 | # -*- coding: utf-8 -*- | ||
423 | 2 | ############################################################################## | ||
424 | 3 | # | ||
425 | 4 | # OpenERP, Open Source Management Solution | ||
426 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
427 | 6 | # | ||
428 | 7 | # This program is free software: you can redistribute it and/or modify | ||
429 | 8 | # it under the terms of the GNU Affero General Public License as | ||
430 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
431 | 10 | # License, or (at your option) any later version. | ||
432 | 11 | # | ||
433 | 12 | # This program is distributed in the hope that it will be useful, | ||
434 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
435 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
436 | 15 | # GNU Affero General Public License for more details. | ||
437 | 16 | # | ||
438 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
439 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
440 | 19 | # | ||
441 | 20 | ############################################################################ | ||
442 | 21 | |||
443 | 22 | from . import order | ||
444 | 23 | from . import bom_structure | ||
445 | 24 | |||
446 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
447 | 26 | |||
448 | 0 | 27 | ||
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-03-03 11:00:02 +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 | 67 | ||
520 | === added file 'mrp_webkit/report/bom_structure.py' | |||
521 | --- mrp_webkit/report/bom_structure.py 1970-01-01 00:00:00 +0000 | |||
522 | +++ mrp_webkit/report/bom_structure.py 2014-03-03 11:00:02 +0000 | |||
523 | @@ -0,0 +1,66 @@ | |||
524 | 1 | # -*- coding: utf-8 -*- | ||
525 | 2 | ############################################################################## | ||
526 | 3 | # | ||
527 | 4 | # OpenERP, Open Source Management Solution | ||
528 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
529 | 6 | # | ||
530 | 7 | # This program is free software: you can redistribute it and/or modify | ||
531 | 8 | # it under the terms of the GNU Affero General Public License as | ||
532 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
533 | 10 | # License, or (at your option) any later version. | ||
534 | 11 | # | ||
535 | 12 | # This program is distributed in the hope that it will be useful, | ||
536 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
537 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
538 | 15 | # GNU Affero General Public License for more details. | ||
539 | 16 | # | ||
540 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
541 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
542 | 19 | # | ||
543 | 20 | ############################################################################ | ||
544 | 21 | |||
545 | 22 | import time | ||
546 | 23 | |||
547 | 24 | from openerp.report import report_sxw | ||
548 | 25 | |||
549 | 26 | class bom_structure(report_sxw.rml_parse): | ||
550 | 27 | def __init__(self, cr, uid, name, context): | ||
551 | 28 | super(bom_structure, self).__init__(cr, uid, name, context=context) | ||
552 | 29 | self.localcontext.update({ | ||
553 | 30 | 'time': time, | ||
554 | 31 | 'get_children': self.get_children, | ||
555 | 32 | }) | ||
556 | 33 | |||
557 | 34 | def get_children(self, object, level=0): | ||
558 | 35 | result = [] | ||
559 | 36 | |||
560 | 37 | def _get_rec(object, level): | ||
561 | 38 | for l in object: | ||
562 | 39 | res = {} | ||
563 | 40 | res['name'] = l.name | ||
564 | 41 | res['pname'] = l.product_id.name | ||
565 | 42 | res['pcode'] = l.product_id.default_code | ||
566 | 43 | res['pqty'] = l.product_qty | ||
567 | 44 | res['uname'] = l.product_uom.name | ||
568 | 45 | res['code'] = l.code | ||
569 | 46 | res['level'] = level | ||
570 | 47 | result.append(res) | ||
571 | 48 | if l.child_complete_ids: | ||
572 | 49 | if level < 6: | ||
573 | 50 | level += 1 | ||
574 | 51 | _get_rec(l.child_complete_ids,level) | ||
575 | 52 | if 0 < level < 6: | ||
576 | 53 | level -= 1 | ||
577 | 54 | return result | ||
578 | 55 | |||
579 | 56 | children = _get_rec(object,level) | ||
580 | 57 | |||
581 | 58 | return children | ||
582 | 59 | |||
583 | 60 | report_sxw.report_sxw('report.bom.structure.webkit', | ||
584 | 61 | 'mrp.bom', | ||
585 | 62 | 'mrp_webkit/report/bom_structure.mako', | ||
586 | 63 | parser=bom_structure,header='internal') | ||
587 | 64 | |||
588 | 65 | |||
589 | 66 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
590 | 0 | 67 | ||
591 | === added file 'mrp_webkit/report/order.mako' | |||
592 | --- mrp_webkit/report/order.mako 1970-01-01 00:00:00 +0000 | |||
593 | +++ mrp_webkit/report/order.mako 2014-03-03 11:00:02 +0000 | |||
594 | @@ -0,0 +1,220 @@ | |||
595 | 1 | <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
596 | 2 | |||
597 | 3 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
598 | 4 | <head> | ||
599 | 5 | <style type="text/css"> | ||
600 | 6 | ${css} | ||
601 | 7 | </style> | ||
602 | 8 | <title>Production Order.pdf</title> | ||
603 | 9 | </head> | ||
604 | 10 | <body> | ||
605 | 11 | %for o in objects: | ||
606 | 12 | <table class="title" width="100%"> | ||
607 | 13 | <tr> | ||
608 | 14 | <td width="100%"> | ||
609 | 15 | <h3><b>${ _('Production Order N°') } : ${o.name}</b></h3> | ||
610 | 16 | </td> | ||
611 | 17 | </tr> | ||
612 | 18 | </table> | ||
613 | 19 | |||
614 | 20 | <table width="100%" class="list_table2"> | ||
615 | 21 | <tr> | ||
616 | 22 | <td width="35%"> | ||
617 | 23 | <b>${ _('Source Document') }</b> | ||
618 | 24 | </td> | ||
619 | 25 | <td width="40%"> | ||
620 | 26 | <b>${ _('Product') }</b> | ||
621 | 27 | </td> | ||
622 | 28 | <td width="25%"> | ||
623 | 29 | <b>${ _('Quantity') }</b> | ||
624 | 30 | </td> | ||
625 | 31 | </tr> | ||
626 | 32 | </table> | ||
627 | 33 | <table width="100%" class="list_table2"> | ||
628 | 34 | <tr> | ||
629 | 35 | <td width="35%"> | ||
630 | 36 | ${o.origin or ''} | ||
631 | 37 | </td> | ||
632 | 38 | <td width="40%"> | ||
633 | 39 | ${o.product_id and o.product_id.code or ''} ${o.product_id and o.product_id.name or ''} | ||
634 | 40 | </td> | ||
635 | 41 | <td width="25%"> | ||
636 | 42 | ${formatLang(o.product_qty)} ${o.product_id and o.product_uom and o.product_uom.name or ''} | ||
637 | 43 | </td> | ||
638 | 44 | </tr> | ||
639 | 45 | </table> | ||
640 | 46 | <br/> | ||
641 | 47 | |||
642 | 48 | <table width="100%" class="list_table2"> | ||
643 | 49 | <tr> | ||
644 | 50 | <td width="35%"> | ||
645 | 51 | <b>${ _('Scheduled Date') }</b> | ||
646 | 52 | </td> | ||
647 | 53 | <td width="18%"> | ||
648 | 54 | <b>${ _('Printing date') }</b> | ||
649 | 55 | </td> | ||
650 | 56 | <td width="22%"> | ||
651 | 57 | <b>${ _('Partner Ref') }</b> | ||
652 | 58 | </td> | ||
653 | 59 | <td width="25%"> | ||
654 | 60 | <b>${ _('SO Number') }</b> | ||
655 | 61 | </td> | ||
656 | 62 | </tr> | ||
657 | 63 | </table> | ||
658 | 64 | <table width="100%" class="list_table2"> | ||
659 | 65 | <tr> | ||
660 | 66 | <td width="35%"> | ||
661 | 67 | ${formatLang(o.date_planned, date_time = True)} | ||
662 | 68 | </td> | ||
663 | 69 | <td width="18%"> | ||
664 | 70 | ${formatLang(time.strftime('%Y-%m-%d'),date = True)} | ||
665 | 71 | </td> | ||
666 | 72 | <td width="22%"> | ||
667 | 73 | ${'sale_ref' in o._columns.keys() and o.sale_ref or ''} | ||
668 | 74 | </td> | ||
669 | 75 | <td width="25%"> | ||
670 | 76 | ${'sale_name' in o._columns.keys() and o.sale_name or ''} | ||
671 | 77 | </td> | ||
672 | 78 | </tr> | ||
673 | 79 | </table> | ||
674 | 80 | <br/> | ||
675 | 81 | |||
676 | 82 | %if o.workcenter_lines ==[]: | ||
677 | 83 | |||
678 | 84 | %else: | ||
679 | 85 | <table width="100%"> | ||
680 | 86 | <tr> | ||
681 | 87 | <td style="text-align:left;" width="100%"> | ||
682 | 88 | <h4><b>${ _('Work Orders') }</b></h4> | ||
683 | 89 | </td> | ||
684 | 90 | </tr> | ||
685 | 91 | </table> | ||
686 | 92 | <table width="100%" class="list_table2"> | ||
687 | 93 | <tr> | ||
688 | 94 | <td width="15%"> | ||
689 | 95 | <b>${ _('Sequence') }</b> | ||
690 | 96 | </td> | ||
691 | 97 | <td width="30%"> | ||
692 | 98 | <b>${ _('Name') }</b> | ||
693 | 99 | </td> | ||
694 | 100 | <td width="30%"> | ||
695 | 101 | <b>${ _('WorkCenter') }</b> | ||
696 | 102 | </td> | ||
697 | 103 | <td width="12%"> | ||
698 | 104 | <b>${ _('No. Of Cycles') }</b> | ||
699 | 105 | </td> | ||
700 | 106 | <td width="13%"> | ||
701 | 107 | <b>${ _('No. Of Hours') }</b> | ||
702 | 108 | </td> | ||
703 | 109 | </tr> | ||
704 | 110 | </table> | ||
705 | 111 | %for line2 in o.workcenter_lines: | ||
706 | 112 | <table width="100%" class="list_table2"> | ||
707 | 113 | <tr> | ||
708 | 114 | <td width="15%"> | ||
709 | 115 | ${str(line2.sequence)} | ||
710 | 116 | </td> | ||
711 | 117 | <td width="30%"> | ||
712 | 118 | ${line2.name} | ||
713 | 119 | </td> | ||
714 | 120 | <td width="30%"> | ||
715 | 121 | ${line2.workcenter_id and line2.workcenter_id.name or ''} | ||
716 | 122 | </td> | ||
717 | 123 | <td width="12%"> | ||
718 | 124 | ${formatLang(line2.cycle)} | ||
719 | 125 | </td> | ||
720 | 126 | <td width="13%"> | ||
721 | 127 | ${formatLang(line2.hour)} | ||
722 | 128 | </td> | ||
723 | 129 | </tr> | ||
724 | 130 | </table><br/> | ||
725 | 131 | %endfor | ||
726 | 132 | %endif | ||
727 | 133 | |||
728 | 134 | <table class="title" width="100%"> | ||
729 | 135 | <tr> | ||
730 | 136 | <td width="100%"> | ||
731 | 137 | <h3>${ _('Bill Of Material') }</h3> | ||
732 | 138 | </td> | ||
733 | 139 | </tr> | ||
734 | 140 | </table> | ||
735 | 141 | <table style="border-bottom:2px solid black;font-family: Helvetica; font-size:11px;" width="100%" > | ||
736 | 142 | <tr> | ||
737 | 143 | <td style="text-align:left; " width="55%"> | ||
738 | 144 | <b>${ _('Product') }</b> | ||
739 | 145 | </td> | ||
740 | 146 | <td style="text-align:right;" width="10%"> | ||
741 | 147 | <b>${ _('Quantity') }</b> | ||
742 | 148 | </td> | ||
743 | 149 | <td style="text-align:center;" width="20%"> | ||
744 | 150 | <b>${ _('Source Location') }</b> | ||
745 | 151 | </td> | ||
746 | 152 | <td style="text-align:center;" width="15%"> | ||
747 | 153 | <b>${ _('Destination Location') }</b> | ||
748 | 154 | </td> | ||
749 | 155 | </tr> | ||
750 | 156 | </table> | ||
751 | 157 | |||
752 | 158 | %if o.move_lines ==[]: | ||
753 | 159 | |||
754 | 160 | %else: | ||
755 | 161 | <table style="font-family: Helvetica; font-size:11px;" width="100%"> | ||
756 | 162 | <tr> | ||
757 | 163 | <td width="100%"> | ||
758 | 164 | <b>${ _('Products to Consume') }</b> | ||
759 | 165 | </td> | ||
760 | 166 | </tr> | ||
761 | 167 | </table> | ||
762 | 168 | %for line in o.move_lines: | ||
763 | 169 | <table width="100%" class="list_table"> | ||
764 | 170 | <tr> | ||
765 | 171 | <td style="text-align:left;" width="55%"> | ||
766 | 172 | ${line.product_id and line.product_id.code or ''} ${line.product_id and line.product_id.name or ''} | ||
767 | 173 | </td> | ||
768 | 174 | <td style="text-align:right;" width="10%"> | ||
769 | 175 | ${formatLang( line.product_qty)} ${line.product_uom and line.product_uom.name or ''} | ||
770 | 176 | </td> | ||
771 | 177 | <td style="text-align:center;"width="20%"> | ||
772 | 178 | ${line.location_id and line.location_id.name or ''} | ||
773 | 179 | </td> | ||
774 | 180 | <td style="text-align:center;"width="15%"> | ||
775 | 181 | ${line.location_dest_id and line.location_dest_id.name or ''} | ||
776 | 182 | </td> | ||
777 | 183 | </tr> | ||
778 | 184 | </table> | ||
779 | 185 | %endfor | ||
780 | 186 | %endif | ||
781 | 187 | |||
782 | 188 | %if o.move_lines2 ==[]: | ||
783 | 189 | |||
784 | 190 | %else: | ||
785 | 191 | <table class="title" width="100%"> | ||
786 | 192 | <tr> | ||
787 | 193 | <td width="100%"> | ||
788 | 194 | <h5><b>${ _('Consumed Products') }</b></h5> | ||
789 | 195 | </td> | ||
790 | 196 | </tr> | ||
791 | 197 | </table> | ||
792 | 198 | %for line2 in o.move_lines2: | ||
793 | 199 | <table width="100%" class="list_table1"> | ||
794 | 200 | <tr> | ||
795 | 201 | <td style="text-align:left;"width="55%"> | ||
796 | 202 | ${line2.product_id and line2.product_id.code or ''} ${line2.product_id and line2.product_id.name or ''} | ||
797 | 203 | </td> | ||
798 | 204 | <td style="text-align:right;"width="10%"> | ||
799 | 205 | ${formatLang( line2.product_qty)} ${line2.product_uom and line2.product_uom.name or ''} | ||
800 | 206 | </td> | ||
801 | 207 | <td style="text-align:center;"width="20%"> | ||
802 | 208 | ${line2.location_id and line2.location_id.name or ''} | ||
803 | 209 | </td> | ||
804 | 210 | <td style="text-align:center;"width="15%"> | ||
805 | 211 | ${line2.location_dest_id and line2.location_dest_id.name or ''} | ||
806 | 212 | </td> | ||
807 | 213 | </tr> | ||
808 | 214 | </table> | ||
809 | 215 | %endfor | ||
810 | 216 | %endif | ||
811 | 217 | <p style="page-break-after:always"></p> | ||
812 | 218 | %endfor | ||
813 | 219 | </body> | ||
814 | 220 | </html> | ||
815 | 0 | 221 | ||
816 | === added file 'mrp_webkit/report/order.py' | |||
817 | --- mrp_webkit/report/order.py 1970-01-01 00:00:00 +0000 | |||
818 | +++ mrp_webkit/report/order.py 2014-03-03 11:00:02 +0000 | |||
819 | @@ -0,0 +1,39 @@ | |||
820 | 1 | # -*- coding: utf-8 -*- | ||
821 | 2 | ############################################################################## | ||
822 | 3 | # | ||
823 | 4 | # OpenERP, Open Source Management Solution | ||
824 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
825 | 6 | # | ||
826 | 7 | # This program is free software: you can redistribute it and/or modify | ||
827 | 8 | # it under the terms of the GNU Affero General Public License as | ||
828 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
829 | 10 | # License, or (at your option) any later version. | ||
830 | 11 | # | ||
831 | 12 | # This program is distributed in the hope that it will be useful, | ||
832 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
833 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
834 | 15 | # GNU Affero General Public License for more details. | ||
835 | 16 | # | ||
836 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
837 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
838 | 19 | # | ||
839 | 20 | ############################################################################ | ||
840 | 21 | |||
841 | 22 | import time | ||
842 | 23 | |||
843 | 24 | from openerp.report import report_sxw | ||
844 | 25 | |||
845 | 26 | class order(report_sxw.rml_parse): | ||
846 | 27 | def __init__(self, cr, uid, name, context): | ||
847 | 28 | super(order, self).__init__(cr, uid, name, context=context) | ||
848 | 29 | self.localcontext.update({ | ||
849 | 30 | 'time': time, | ||
850 | 31 | }) | ||
851 | 32 | |||
852 | 33 | report_sxw.report_sxw('report.mrp.production.order.webkit', | ||
853 | 34 | 'mrp.production', | ||
854 | 35 | 'addons/mrp_webkit/report/order.mako', | ||
855 | 36 | parser=order, | ||
856 | 37 | header='internal') | ||
857 | 38 | |||
858 | 39 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
Thanks