Merge lp:~camptocamp/openerp-mrp-reports/7.0-add_serpentcs_mrp_webkit-afe into lp:~openerp-community-reviewer/openerp-mrp-reports/7.0

Proposed by Alexandre Fayolle - camptocamp on 2014-03-03
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
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp 2014-03-03 Approve on 2014-03-21
Alex Comba - Agile BG (community) code review, no test Approve on 2014-03-21
Lorenzo Battistini (community) code review Approve on 2014-03-21
Review via email: mp+209039@code.launchpad.net

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.
review: Approve (code review)
review: Approve (code review, no test)

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'mrp_webkit'
=== added file 'mrp_webkit/__init__.py'
--- mrp_webkit/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_webkit/__init__.py 2014-03-03 11:00:02 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22from . import report
23
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
025
=== added file 'mrp_webkit/__openerp__.py'
--- mrp_webkit/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_webkit/__openerp__.py 2014-03-03 11:00:02 +0000
@@ -0,0 +1,46 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services Pvt. Ltd.(<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22
23{
24 'name': 'MRP',
25 'version': '1.0',
26 'author': 'Serpent Consulting Services Pvt. Ltd.',
27 'website': 'http://www.serpentcs.com',
28 'category': 'Manufacturing',
29 'sequence': 18,
30 'summary': 'Manufacturing Orders, Bill of Materials, Routing',
31 'depends': ['mrp','report_webkit'],
32 'description': """
33Manage the Manufacturing process in OpenERP
34===========================================
35
36 It is conversion of rml report to Webkit Report.
37
38 """,
39 'data': [
40 'mrp_report.xml',
41 ],
42 'installable': True,
43 'application': True,
44 'auto_install': False,
45}
46# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
047
=== added file 'mrp_webkit/mrp_report.xml'
--- mrp_webkit/mrp_report.xml 1970-01-01 00:00:00 +0000
+++ mrp_webkit/mrp_report.xml 2014-03-03 11:00:02 +0000
@@ -0,0 +1,330 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="bom webkit header" model="ir.header_webkit">
5 <field name="footer_html"><![CDATA[]]></field>
6 <field name="orientation">Portrait</field>
7 <field name="format">A4</field>
8 <field name="html"><![CDATA[
9 <html>
10 <head>
11
12 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
13 <script>
14 function subst() {
15 var vars={};
16 var x=document.location.search.substring(1).split('&');
17 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
18 if(vars['page']!=1){
19 document.getElementById('inner_head').innerHTML=document.getElementById('actual_header').innerHTML;
20 }
21 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
22 for(var i in x) {
23 var y = document.getElementsByClassName(x[i]);
24 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
25 }
26 }
27 </script>
28 <style type="text/css">
29 ${css}
30 </style>
31 </head>
32 <body style="border:0; margin:0;" onload="subst()">
33 <table style="border:0" width="100%">
34 <tr>
35 <td width="92%">
36 <td width="4%" style="text-align:right;font-size:10;width:350px;">&nbsp;<span class="page"/></td>
37 <td width="4%" style="text-align:left;font-size:10;width:30px">&nbsp;/&nbsp;<span class="topage"/></td>
38 </tr>
39 </table> ${_debug or ''|n}
40 <table id="inner_head" style="width: 100%;margin-left:1%;margin-right:1%;" >
41
42 </table>${_debug or ''|n}
43 <table id="actual_header" style="display:none;margin-left:5%;" class="basic_table">
44 <tr >
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>
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>
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>
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>
49 </tr>
50 </table>
51 </body>
52</html>]]>
53 </field>
54 <field eval="15.0" name="margin_top"/>
55 <field eval="5.0" name="margin_bottom"/>
56 <field name="css"><![CDATA[
57
58
59
60
61.basic_table{
62border-color:black;
63border-collapse: collapse;
64font-family: Helvetica-Bold;
65}
66.basic_table td {
67border-color:black;
68border-bottom:2px solid black;
69font-size:12px;
70}
71
72.list_table {
73border-color:black;
74border-collapse: collapse;
75font-family: Helvetica;
76}
77.list_table td {
78border-bottom:1px solid #ccc;
79font-size:12px;
80padding-left:3px
81padding-right:3px
82padding-top:3px
83padding-bottom:3px
84}
85.list_table1 {
86border-color:black;
87border-collapse: collapse;
88font-family: Helvetica;
89}
90.list_table1 td {
91border-color:gray;
92border-bottom:2px solid gray;
93font-size:12px;
94
95}
96.list_table2 {
97border-color:black;
98border-collapse: collapse;
99
100}
101.list_table2 td {
102border-color:black;
103border-top:2px solid black;
104border-bottom:2px solid black;
105font-size:12;
106padding-left:3px
107padding-right:3px
108padding-top:3px
109padding-bottom:3px
110}
111.list_table th {
112border-bottom:2px solid black;
113text-align:left;
114font-size:12px;
115font-weight:bold;
116padding-left:3px
117padding-right:3px
118}
119
120.list_tabe thead {
121 display:table-header-group;
122}
123
124
125.total {
126width:100%;
127}
128.lib {
129width:10.3%;
130}
131.tot {
132text-align:left;
133width:15%;
134}
135.righttot {
136width:74%;
137}
138.tax {
139width:50%;
140}
141table {
142 display: table;
143 width: 100%;
144 }
145
146 table thead {
147 display: table-header-group;
148 }
149
150 table tbody {
151 display: table-row-group;
152 }
153
154 table tfoot {
155 display: table-footer-group;
156 }
157
158 table tr {
159 display: table-row;
160 height: auto;
161 }
162
163 table th,
164 table td {
165 display: table-cell;
166 overflow: visible;
167 }
168
169 table th,
170 table td {
171 height: 1px; /* Do the trick to make div.nobrk fill td height */
172 }
173
174 table tr.singlecell td,
175 table tr.singlecell th {
176 height: auto; /* Reset trick for a full row td */
177 }
178
179 .nobrk {
180 page-break-inside: avoid;
181 orphans: 10;
182 widows: 10;
183 position: relative;
184 margin: -1px 0 0 -1px;
185 min-height: 14px;
186 line-height: 14px;
187 height: 100%;
188 }
189
190 table tbody td .nobrk {
191 min-height: 5px;
192 }
193 ]]>
194 </field>
195 <field name="name">bom webkit header</field>
196 </record>
197
198<record id="production webkit header" model="ir.header_webkit">
199 <field name="footer_html"><![CDATA[]]></field>
200 <field name="orientation">Portrait</field>
201 <field name="format">A4</field>
202 <field name="html"><![CDATA[
203 <html>
204 <head>
205
206 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
207 <script>
208 function subst() {
209 var vars={};
210 var x=document.location.search.substring(1).split('&');
211 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
212 if(vars['page']!=1){
213 document.getElementById('inner_head').innerHTML=document.getElementById('actual_header').innerHTML;
214 }
215 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
216 for(var i in x) {
217 var y = document.getElementsByClassName(x[i]);
218 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
219 }
220 }
221 </script>
222 <style type="text/css">
223 ${css}
224 </style>
225 </head>
226 <body style="border:0; margin:0;" onload="subst()">
227 <table class="header" style="border-bottom: 1px solid black; width: 100%">
228 <tr >
229 <td style="text-align:right;font-size:10;font-family: Helvetica-Bold;" width="15%">${ formatLang(time.strftime('%Y-%m-%d'),date=True)}&nbsp;${time.strftime('%I:%M')}</td>
230 <td style="text-align:center;font-size:14; font-family: Helvetica-Bold;" width="75%"><b>${company.partner_id.name |entity}</b></td>
231 <td width="5%" style="text-align:right;font-size:10;width:350px; font-family: Helvetica-Bold;" >&nbsp;<span class="page"/></td>
232 <td width="5%" style="text-align:left;font-size:10;width:30px font-family: Helvetica-Bold;">&nbsp;/&nbsp;<span class="topage"/></td>
233 </tr>
234 </table> ${_debug or ''|n}
235 <table id="inner_head" style="width: 100%;margin-left:1%;margin-right:1%;" >
236
237 </table>${_debug or ''|n}
238 <table id="actual_header" style="display:none;margin-left:5%;" class="basic_table">
239 <tr >
240
241 </tr>
242 </table>
243 </body>
244</html>]]>
245 </field>
246 <field eval="15.0" name="margin_top"/>
247 <field eval="5.0" name="margin_bottom"/>
248 <field name="css"><![CDATA[
249
250.basic_table{
251border-collapse: collapse;
252font-family: Helvetica-Bold;
253}
254.basic_table td {
255border-color:black;
256border-bottom:2px solid black;
257
258}
259
260 .title{
261 text-align:left
262 font-family: Helvetica-Bold;
263 font-size:12px;
264}
265
266.list_table {
267border-color:black;
268border-collapse: collapse;
269font-family: Helvetica;
270}
271.list_table td {
272border-color:gray;
273border-bottom:1px solid gray;
274font-size:12px;
275
276}
277.list_table1 {
278border-color:black;
279border-collapse: collapse;
280font-family: Helvetica;
281font-size:12px;
282}
283.list_table1 td {
284border-color:gray;
285border-bottom:1px solid gray;
286
287
288}
289.list_table2 {
290text-align:center;
291border-collapse: collapse;
292}
293.list_table2 td {
294 border:1px solid lightGrey;
295 border-collapse: collapse;
296 font-family: Helvetica;
297 font-size:11px;
298 }
299
300}
301
302 ]]>
303 </field>
304 <field name="name">production webkit header</field>
305 </record>
306
307 <report
308 auto="True"
309 header="False"
310 id="report_bom_structure"
311 model="mrp.bom"
312 name="bom.structure.webkit"
313 file="mrp_webkit/report/bom_structure.mako"
314 string="BOM Structure"
315 report_type="webkit"
316 webkit_header="bom webkit header"/>
317
318 <report
319 id="report_mrp_production_report"
320 string="Production Order"
321 model="mrp.production"
322 name="mrp.production.order.webkit"
323 file="mrp_webkit/report/order.mako"
324 auto="False"
325 report_type="webkit"
326 webkit_header="production webkit header"
327 />
328
329 </data>
330</openerp>
0331
=== added directory 'mrp_webkit/report'
=== added file 'mrp_webkit/report/__init__.py'
--- mrp_webkit/report/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_webkit/report/__init__.py 2014-03-03 11:00:02 +0000
@@ -0,0 +1,26 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22from . import order
23from . import bom_structure
24
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
26
027
=== added file 'mrp_webkit/report/bom_structure.mako'
--- mrp_webkit/report/bom_structure.mako 1970-01-01 00:00:00 +0000
+++ mrp_webkit/report/bom_structure.mako 2014-03-03 11:00:02 +0000
@@ -0,0 +1,66 @@
1<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3<html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <style type="text/css">
6 ${css}
7 </style>
8 <title>BOM Structure.pdf</title>
9 </head>
10 <body>
11 <table width="100%">
12 <tr>
13 <td style="text-align:center;">
14 <h2><b>${ _('BOM Structure') } </b></h2>
15 </td>
16 </tr>
17 </table>
18
19 <table width="100%" class="basic_table">
20 <tr >
21 <td style="text-align:left;" width="35%"><b>${ _('BOM Name') }</b></td>
22 <td style="text-align:left;" width="35%"><b>${ _('Product Name') }</b></td>
23 <td style="text-align:right;" width="15%"><b>${ _('Quantity') }<b></td>
24 <td style="text-align:center;" width="15%"><b>${ _('BOM Ref') }</b></td>
25 </tr>
26 </table>
27 %for o in objects:
28 <table width="100%" class="list_table1">
29 <tr >
30 <td style="text-align:left;" width="35%"><b>
31 ${o.name}</b>
32 </td>
33 <td style="text-align:left;" width="35%"><b>
34 [ ${(o.product_id.default_code) or removeParentNode('font')}] ${o.product_id.name}</b>
35 </td>
36 <td style="text-align:right;" width="15%"><b>
37 ${o.product_qty} ${o.product_uom.name}</b>
38 </td>
39 <td style="text-align:center;" width="15%"><b>
40 ${o.code or ''}</b>
41 </td><br/>
42 </tr>
43 </table>
44
45 %for l in get_children(o.bom_lines):
46 <table width="100%" class="list_table">
47 <tr>
48 <td style="text-align:left ; padding-left:10px" width="35%" class="cell_extended_gray">
49 <font color="white" >${'... '*(l['level'])}</font> - ${l['name']}
50 </td>
51 <td style="text-align:left;" width="35%" class="cell_extended_gray">
52 ${ (l['pcode']) or '' } ${l['pname']}
53 </td>
54 <td style="text-align:right;" width="15%" class="cell_extended_gray">
55 ${l['pqty']} ${l['uname']}
56 </td>
57 <td style="text-align:center;" width="15%" class="cell_extended_gray">
58 ${l['code'] or ''}
59 </td>
60 </tr>
61 </table>
62 %endfor
63 </br>
64 %endfor
65</body>
66</html>
067
=== added file 'mrp_webkit/report/bom_structure.py'
--- mrp_webkit/report/bom_structure.py 1970-01-01 00:00:00 +0000
+++ mrp_webkit/report/bom_structure.py 2014-03-03 11:00:02 +0000
@@ -0,0 +1,66 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22import time
23
24from openerp.report import report_sxw
25
26class bom_structure(report_sxw.rml_parse):
27 def __init__(self, cr, uid, name, context):
28 super(bom_structure, self).__init__(cr, uid, name, context=context)
29 self.localcontext.update({
30 'time': time,
31 'get_children': self.get_children,
32 })
33
34 def get_children(self, object, level=0):
35 result = []
36
37 def _get_rec(object, level):
38 for l in object:
39 res = {}
40 res['name'] = l.name
41 res['pname'] = l.product_id.name
42 res['pcode'] = l.product_id.default_code
43 res['pqty'] = l.product_qty
44 res['uname'] = l.product_uom.name
45 res['code'] = l.code
46 res['level'] = level
47 result.append(res)
48 if l.child_complete_ids:
49 if level < 6:
50 level += 1
51 _get_rec(l.child_complete_ids,level)
52 if 0 < level < 6:
53 level -= 1
54 return result
55
56 children = _get_rec(object,level)
57
58 return children
59
60report_sxw.report_sxw('report.bom.structure.webkit',
61 'mrp.bom',
62 'mrp_webkit/report/bom_structure.mako',
63 parser=bom_structure,header='internal')
64
65
66# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
067
=== added file 'mrp_webkit/report/order.mako'
--- mrp_webkit/report/order.mako 1970-01-01 00:00:00 +0000
+++ mrp_webkit/report/order.mako 2014-03-03 11:00:02 +0000
@@ -0,0 +1,220 @@
1<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3<html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <style type="text/css">
6 ${css}
7 </style>
8 <title>Production Order.pdf</title>
9 </head>
10 <body>
11 %for o in objects:
12 <table class="title" width="100%">
13 <tr>
14 <td width="100%">
15 <h3><b>${ _('Production Order N°') } : ${o.name}</b></h3>
16 </td>
17 </tr>
18 </table>
19
20 <table width="100%" class="list_table2">
21 <tr>
22 <td width="35%">
23 <b>${ _('Source Document') }</b>
24 </td>
25 <td width="40%">
26 <b>${ _('Product') }</b>
27 </td>
28 <td width="25%">
29 <b>${ _('Quantity') }</b>
30 </td>
31 </tr>
32 </table>
33 <table width="100%" class="list_table2">
34 <tr>
35 <td width="35%">
36 ${o.origin or ''}
37 </td>
38 <td width="40%">
39 ${o.product_id and o.product_id.code or ''} ${o.product_id and o.product_id.name or ''}
40 </td>
41 <td width="25%">
42 ${formatLang(o.product_qty)} ${o.product_id and o.product_uom and o.product_uom.name or ''}
43 </td>
44 </tr>
45 </table>
46 <br/>
47
48 <table width="100%" class="list_table2">
49 <tr>
50 <td width="35%">
51 <b>${ _('Scheduled Date') }</b>
52 </td>
53 <td width="18%">
54 <b>${ _('Printing date') }</b>
55 </td>
56 <td width="22%">
57 <b>${ _('Partner Ref') }</b>
58 </td>
59 <td width="25%">
60 <b>${ _('SO Number') }</b>
61 </td>
62 </tr>
63 </table>
64 <table width="100%" class="list_table2">
65 <tr>
66 <td width="35%">
67 ${formatLang(o.date_planned, date_time = True)}
68 </td>
69 <td width="18%">
70 ${formatLang(time.strftime('%Y-%m-%d'),date = True)}
71 </td>
72 <td width="22%">
73 ${'sale_ref' in o._columns.keys() and o.sale_ref or ''}
74 </td>
75 <td width="25%">
76 ${'sale_name' in o._columns.keys() and o.sale_name or ''}
77 </td>
78 </tr>
79 </table>
80 <br/>
81
82 %if o.workcenter_lines ==[]:
83
84 %else:
85 <table width="100%">
86 <tr>
87 <td style="text-align:left;" width="100%">
88 <h4><b>${ _('Work Orders') }</b></h4>
89 </td>
90 </tr>
91 </table>
92 <table width="100%" class="list_table2">
93 <tr>
94 <td width="15%">
95 <b>${ _('Sequence') }</b>
96 </td>
97 <td width="30%">
98 <b>${ _('Name') }</b>
99 </td>
100 <td width="30%">
101 <b>${ _('WorkCenter') }</b>
102 </td>
103 <td width="12%">
104 <b>${ _('No. Of Cycles') }</b>
105 </td>
106 <td width="13%">
107 <b>${ _('No. Of Hours') }</b>
108 </td>
109 </tr>
110 </table>
111 %for line2 in o.workcenter_lines:
112 <table width="100%" class="list_table2">
113 <tr>
114 <td width="15%">
115 ${str(line2.sequence)}
116 </td>
117 <td width="30%">
118 ${line2.name}
119 </td>
120 <td width="30%">
121 ${line2.workcenter_id and line2.workcenter_id.name or ''}
122 </td>
123 <td width="12%">
124 ${formatLang(line2.cycle)}
125 </td>
126 <td width="13%">
127 ${formatLang(line2.hour)}
128 </td>
129 </tr>
130 </table><br/>
131 %endfor
132 %endif
133
134 <table class="title" width="100%">
135 <tr>
136 <td width="100%">
137 <h3>${ _('Bill Of Material') }</h3>
138 </td>
139 </tr>
140 </table>
141 <table style="border-bottom:2px solid black;font-family: Helvetica; font-size:11px;" width="100%" >
142 <tr>
143 <td style="text-align:left; " width="55%">
144 <b>${ _('Product') }</b>
145 </td>
146 <td style="text-align:right;" width="10%">
147 <b>${ _('Quantity') }</b>
148 </td>
149 <td style="text-align:center;" width="20%">
150 <b>${ _('Source Location') }</b>
151 </td>
152 <td style="text-align:center;" width="15%">
153 <b>${ _('Destination Location') }</b>
154 </td>
155 </tr>
156 </table>
157
158 %if o.move_lines ==[]:
159
160 %else:
161 <table style="font-family: Helvetica; font-size:11px;" width="100%">
162 <tr>
163 <td width="100%">
164 <b>${ _('Products to Consume') }</b>
165 </td>
166 </tr>
167 </table>
168 %for line in o.move_lines:
169 <table width="100%" class="list_table">
170 <tr>
171 <td style="text-align:left;" width="55%">
172 ${line.product_id and line.product_id.code or ''} ${line.product_id and line.product_id.name or ''}
173 </td>
174 <td style="text-align:right;" width="10%">
175 ${formatLang( line.product_qty)} ${line.product_uom and line.product_uom.name or ''}
176 </td>
177 <td style="text-align:center;"width="20%">
178 ${line.location_id and line.location_id.name or ''}
179 </td>
180 <td style="text-align:center;"width="15%">
181 ${line.location_dest_id and line.location_dest_id.name or ''}
182 </td>
183 </tr>
184 </table>
185 %endfor
186 %endif
187
188 %if o.move_lines2 ==[]:
189
190 %else:
191 <table class="title" width="100%">
192 <tr>
193 <td width="100%">
194 <h5><b>${ _('Consumed Products') }</b></h5>
195 </td>
196 </tr>
197 </table>
198 %for line2 in o.move_lines2:
199 <table width="100%" class="list_table1">
200 <tr>
201 <td style="text-align:left;"width="55%">
202 ${line2.product_id and line2.product_id.code or ''} ${line2.product_id and line2.product_id.name or ''}
203 </td>
204 <td style="text-align:right;"width="10%">
205 ${formatLang( line2.product_qty)} ${line2.product_uom and line2.product_uom.name or ''}
206 </td>
207 <td style="text-align:center;"width="20%">
208 ${line2.location_id and line2.location_id.name or ''}
209 </td>
210 <td style="text-align:center;"width="15%">
211 ${line2.location_dest_id and line2.location_dest_id.name or ''}
212 </td>
213 </tr>
214 </table>
215 %endfor
216 %endif
217 <p style="page-break-after:always"></p>
218 %endfor
219 </body>
220</html>
0221
=== added file 'mrp_webkit/report/order.py'
--- mrp_webkit/report/order.py 1970-01-01 00:00:00 +0000
+++ mrp_webkit/report/order.py 2014-03-03 11:00:02 +0000
@@ -0,0 +1,39 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22import time
23
24from openerp.report import report_sxw
25
26class order(report_sxw.rml_parse):
27 def __init__(self, cr, uid, name, context):
28 super(order, self).__init__(cr, uid, name, context=context)
29 self.localcontext.update({
30 'time': time,
31 })
32
33report_sxw.report_sxw('report.mrp.production.order.webkit',
34 'mrp.production',
35 'addons/mrp_webkit/report/order.mako',
36 parser=order,
37 header='internal')
38
39# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches