Merge lp:~vauxoo/addons-vauxoo/report_production_dev_rodo into lp:addons-vauxoo

Proposed by Rodolfo Lopez
Status: Superseded
Proposed branch: lp:~vauxoo/addons-vauxoo/report_production_dev_rodo
Merge into: lp:addons-vauxoo
Diff against target: 651 lines (+589/-0)
11 files modified
report_process_production/__init__.py (+2/-0)
report_process_production/__openerp__.py (+41/-0)
report_process_production/process_report.xml (+15/-0)
report_process_production/report/__init__.py (+2/-0)
report_process_production/report/process_production_report.py (+51/-0)
report_process_production/report/process_production_report.rml (+135/-0)
report_process_production/report/process_production_report_group.py (+73/-0)
report_process_production/report/process_production_report_group.rml (+132/-0)
report_process_production/wizard/__init__.py (+1/-0)
report_process_production/wizard/wizard_report_process.py (+92/-0)
report_process_production/wizard/wizard_report_process.xml (+45/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/report_production_dev_rodo
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Needs Fixing
Review via email: mp+126147@code.launchpad.net

This proposal has been superseded by a proposal from 2012-09-25.

Description of the change

[ADD][report_process_production]

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Cuando le doy click desde el reporte, me da el siguiente error:
   flow = self._flowable(node)
  File "/home/moylop260/openerp/instancias/6.1/server/openerp/report/render/rml2pdf/trml2pdf.py", line 793, in _flowable
    return self._table(node)
  File "/home/moylop260/openerp/instancias/6.1/server/openerp/report/render/rml2pdf/trml2pdf.py", line 644, in _table
    for tr in children:
  File "/home/moylop260/openerp/instancias/6.1/server/openerp/report/render/rml2pdf/utils.py", line 64, in _child_get
    for ctx in eval(n.get('rml_loop'),{}, self.localcontext):
  File "/home/moylop260/openerp/instancias/6.1/server/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
KeyError: 'form'
2012-09-25 04:31:22,275 5880 ERROR ? openerp.netsvc: form
(<type 'exceptions.KeyError'>, KeyError('form',), <traceback object at 0x7f9ba970a7e8>)

Cuando lo mando imprimir desde el wizard todo está bien.

Solo es poner el key2 a client_print_multi al wizard y listo, o algo así

review: Needs Fixing
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Excelente trabajo!

En donde dice "Reallll", cambiarle a "Real"

review: Needs Fixing
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Cuando consideres sumar
una variable
product_qty

Siempre considerar la variante de
product_uom

Es decir,
1 kg + 100 gr = 1.100 kg

Ya existen funciones al respecto,

Por ejemplo, básate en mrp_variation/mrp_variation.py:: def create_res_real_planned
qty_uom_convert=self.pool.get('product.uom')._compute_qty(cr, uid, UOM_DEL_MOVIMIENTO, CANTIDAD_DEL_MOVIMIENTO, to_uom_id=product.uom_id.id)

review: Needs Fixing
467. By Rodolfo Lopez

[REF][report_process_production] convert uom

468. By Rodolfo Lopez

[REF][report_process_production/process_report.xml]

469. By Rodolfo Lopez

[REF][report_process_production] agregar combo para imprimir: agrupado, sin agrupar o ambos

470. By Rodolfo Lopez

[REF][report_process_production] only one parser and rml

471. By Rodolfo Lopez

[REF] [report_process_production} lines in tables

472. By Rodolfo Lopez

[REF] [report_process_production] add product code

473. By Rodolfo Lopez

[FIX][report_process_production] error al eliminar un objeto de la lista de objetos, solucionado

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'report_process_production'
2=== added file 'report_process_production/__init__.py'
3--- report_process_production/__init__.py 1970-01-01 00:00:00 +0000
4+++ report_process_production/__init__.py 2012-09-25 03:45:24 +0000
5@@ -0,0 +1,2 @@
6+import wizard
7+import report
8
9=== added file 'report_process_production/__openerp__.py'
10--- report_process_production/__openerp__.py 1970-01-01 00:00:00 +0000
11+++ report_process_production/__openerp__.py 2012-09-25 03:45:24 +0000
12@@ -0,0 +1,41 @@
13+# -*- encoding: utf-8 -*-
14+###########################################################################
15+# Module Writen to OpenERP, Open Source Management Solution
16+#
17+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
18+# All Rights Reserved.
19+# info Vauxoo (info@vauxoo.com)
20+############################################################################
21+# Coded by: el_rodo_1 (rodo@vauxoo.com)
22+############################################################################
23+#
24+# This program is free software: you can redistribute it and/or modify
25+# it under the terms of the GNU Affero General Public License as
26+# published by the Free Software Foundation, either version 3 of the
27+# License, or (at your option) any later version.
28+#
29+# This program is distributed in the hope that it will be useful,
30+# but WITHOUT ANY WARRANTY; without even the implied warranty of
31+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32+# GNU Affero General Public License for more details.
33+#
34+# You should have received a copy of the GNU Affero General Public License
35+# along with this program. If not, see <http://www.gnu.org/licenses/>.
36+#
37+##############################################################################
38+
39+{
40+ "name" : "report_process_production",
41+ "version" : "1.0",
42+ "author" : "Vauxoo",
43+ "category" : "MRP",
44+ "description" : """Report Process Production""",
45+ "website" : "http://www.vauxoo.com/",
46+ "license" : "AGPL-3",
47+ "depends" : ["mrp"],
48+ "init_xml" : [],
49+ "demo_xml" : [],
50+ "update_xml" : ["wizard/wizard_report_process.xml","process_report.xml"],
51+ "installable" : True,
52+ "active" : False,
53+}
54
55=== added file 'report_process_production/process_production_report.rml'
56=== added file 'report_process_production/process_report.xml'
57--- report_process_production/process_report.xml 1970-01-01 00:00:00 +0000
58+++ report_process_production/process_report.xml 2012-09-25 03:45:24 +0000
59@@ -0,0 +1,15 @@
60+<?xml version="1.0"?>
61+<openerp>
62+ <data>
63+ <report id="process_report"
64+ name="process.report"
65+ string="Report Process"
66+ model="mrp.production"
67+ rml='report_process_production/report/process_production_report.rml'
68+ auto="False"
69+ header="False"
70+ menu="True"
71+ multi="True"
72+ />
73+ </data>
74+</openerp>
75
76=== added directory 'report_process_production/report'
77=== added file 'report_process_production/report/__init__.py'
78--- report_process_production/report/__init__.py 1970-01-01 00:00:00 +0000
79+++ report_process_production/report/__init__.py 2012-09-25 03:45:24 +0000
80@@ -0,0 +1,2 @@
81+import process_production_report
82+import process_production_report_group
83
84=== added file 'report_process_production/report/process_production_report.py'
85--- report_process_production/report/process_production_report.py 1970-01-01 00:00:00 +0000
86+++ report_process_production/report/process_production_report.py 2012-09-25 03:45:24 +0000
87@@ -0,0 +1,51 @@
88+# -*- coding: utf-8 -*-
89+##############################################################################
90+#
91+# OpenERP, Open Source Management Solution
92+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
93+#
94+# This program is free software: you can redistribute it and/or modify
95+# it under the terms of the GNU Affero General Public License as
96+# published by the Free Software Foundation, either version 3 of the
97+# License, or (at your option) any later version.
98+#
99+# This program is distributed in the hope that it will be useful,
100+# but WITHOUT ANY WARRANTY; without even the implied warranty of
101+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102+# GNU Affero General Public License for more details.
103+#
104+# You should have received a copy of the GNU Affero General Public License
105+# along with this program. If not, see <http://www.gnu.org/licenses/>.
106+#
107+##############################################################################
108+
109+import time
110+from report import report_sxw
111+from osv import osv
112+import pooler
113+from tools.amount_to_text import amount_to_text
114+from tools.translate import _
115+
116+class process_report(report_sxw.rml_parse):
117+ def __init__(self, cr, uid, name, context):
118+ super(process_report, self).__init__(cr, uid, name, context=context)
119+ self.localcontext.update({
120+ 'time': time,
121+ 'get_production':self._get_production,
122+ })
123+
124+ def _get_production(self, data,prod_id):
125+ res=[]
126+ pool = pooler.get_pool(self.cr.dbname)
127+ obj_prod=pool.get('mrp.production')
128+ for prod in obj_prod.browse(self.cr, self.uid, [prod_id]):
129+ for line in prod.move_lines:
130+ if line.product_id.id in data['product_ids']:
131+ res.append(line)
132+ print res,"aqui estaaaaa"
133+ return res
134+
135+report_sxw.report_sxw('report.process.report','mrp.production','addons/report_process_production/report/process_production_report.rml',parser=process_report,header=False)
136+
137+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
138+
139
140=== added file 'report_process_production/report/process_production_report.rml'
141--- report_process_production/report/process_production_report.rml 1970-01-01 00:00:00 +0000
142+++ report_process_production/report/process_production_report.rml 2012-09-25 03:45:24 +0000
143@@ -0,0 +1,135 @@
144+<?xml version="1.0"?>
145+<document filename="test.pdf">
146+ <template pageSize="(612.0,792.0)" title="Test" author="Martin Simon" allowSplitting="20">
147+ <pageTemplate id="first">
148+ <frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
149+ </pageTemplate>
150+ </template>
151+ <stylesheet>
152+ <blockTableStyle id="Standard_Outline">
153+ <blockAlignment value="LEFT"/>
154+ <blockValign value="TOP"/>
155+ </blockTableStyle>
156+ <blockTableStyle id="Table1">
157+ <blockAlignment value="LEFT"/>
158+ <blockValign value="TOP"/>
159+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
160+ <lineStyle kind="LINEAFTER" colorName="#000000" start="0,0" stop="0,-1"/>
161+ <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
162+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
163+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
164+ <lineStyle kind="LINEAFTER" colorName="#000000" start="1,0" stop="1,-1"/>
165+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
166+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
167+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
168+ <lineStyle kind="LINEAFTER" colorName="#000000" start="2,0" stop="2,-1"/>
169+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
170+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
171+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
172+ <lineStyle kind="LINEAFTER" colorName="#000000" start="3,0" stop="3,-1"/>
173+ <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
174+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
175+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
176+ <lineStyle kind="LINEAFTER" colorName="#000000" start="4,0" stop="4,-1"/>
177+ <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
178+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
179+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,1" stop="0,-1"/>
180+ <lineStyle kind="LINEAFTER" colorName="#000000" start="0,1" stop="0,-1"/>
181+ <lineStyle kind="LINEABOVE" colorName="#000000" start="0,1" stop="0,1"/>
182+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
183+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,1" stop="1,-1"/>
184+ <lineStyle kind="LINEAFTER" colorName="#000000" start="1,1" stop="1,-1"/>
185+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,1" stop="1,1"/>
186+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
187+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,1" stop="2,-1"/>
188+ <lineStyle kind="LINEAFTER" colorName="#000000" start="2,1" stop="2,-1"/>
189+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,1" stop="2,1"/>
190+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
191+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,1" stop="3,-1"/>
192+ <lineStyle kind="LINEAFTER" colorName="#000000" start="3,1" stop="3,-1"/>
193+ <lineStyle kind="LINEABOVE" colorName="#000000" start="3,1" stop="3,1"/>
194+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
195+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,1" stop="4,-1"/>
196+ <lineStyle kind="LINEAFTER" colorName="#000000" start="4,1" stop="4,-1"/>
197+ <lineStyle kind="LINEABOVE" colorName="#000000" start="4,1" stop="4,1"/>
198+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
199+ </blockTableStyle>
200+ <initialize>
201+ <paraStyle name="all" alignment="justify"/>
202+ </initialize>
203+ <paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
204+ <paraStyle name="P2" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
205+ <paraStyle name="P3" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
206+ <paraStyle name="P4" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
207+ <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
208+ <paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
209+ <paraStyle name="P7" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
210+ <paraStyle name="Standard" fontName="Helvetica"/>
211+ <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
212+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
213+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
214+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
215+ <paraStyle name="Index" fontName="Helvetica"/>
216+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
217+ <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
218+ <paraStyle name="Table Contents" fontName="Helvetica"/>
219+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
220+ <images/>
221+ </stylesheet>
222+ <story>
223+ <section>
224+ <para style="P4">Reporte De Proceso De Producción</para>
225+ <para style="P5">
226+ <font color="white"> </font>
227+ </para>
228+ <para style="P5">[[repeatIn(objects,'o')]]</para>
229+ <para style="P2">Producción: [[ o.name ]] , Producto: [[o.product_id.name ]]</para>
230+ <blockTable colWidths="169.0,72.0,69.0,120.0,69.0" style="Table1">
231+ <tr>
232+ <td>
233+ <para style="P1">Nombre</para>
234+ </td>
235+ <td>
236+ <para style="P1">Cantidad</para>
237+ </td>
238+ <td>
239+ <para style="P1">UOM</para>
240+ </td>
241+ <td>
242+ <para style="P1">Categoria</para>
243+ </td>
244+ <td>
245+ <para style="P1">Reallllll</para>
246+ </td>
247+ </tr>
248+ <tr>
249+ <td>
250+ <para style="P6">[[ repeatIn(get_production(data['form'], o.id ), 'p' ) ]]</para>
251+ <para style="P6">[[ p.product_id.name ]]</para>
252+ </td>
253+ <td>
254+ <para style="P6">[[ p.product_qty ]]</para>
255+ </td>
256+ <td>
257+ <para style="P6">[[ p.product_uom.name ]]</para>
258+ </td>
259+ <td>
260+ <para style="P6">[[ p.product_id.categ_id.name ]]</para>
261+ </td>
262+ <td>
263+ <para style="P1">
264+ <font color="white"> </font>
265+ </para>
266+ </td>
267+ </tr>
268+ </blockTable>
269+ <para style="P3">
270+ <font color="white"> </font>
271+ </para>
272+ </section>
273+ <para style="P3">
274+ <font color="white"> </font>
275+ </para>
276+ </story>
277+</document>
278+
279
280=== added file 'report_process_production/report/process_production_report.sxw'
281Binary files report_process_production/report/process_production_report.sxw 1970-01-01 00:00:00 +0000 and report_process_production/report/process_production_report.sxw 2012-09-25 03:45:24 +0000 differ
282=== added file 'report_process_production/report/process_production_report_group.py'
283--- report_process_production/report/process_production_report_group.py 1970-01-01 00:00:00 +0000
284+++ report_process_production/report/process_production_report_group.py 2012-09-25 03:45:24 +0000
285@@ -0,0 +1,73 @@
286+# -*- coding: utf-8 -*-
287+##############################################################################
288+#
289+# OpenERP, Open Source Management Solution
290+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
291+#
292+# This program is free software: you can redistribute it and/or modify
293+# it under the terms of the GNU Affero General Public License as
294+# published by the Free Software Foundation, either version 3 of the
295+# License, or (at your option) any later version.
296+#
297+# This program is distributed in the hope that it will be useful,
298+# but WITHOUT ANY WARRANTY; without even the implied warranty of
299+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
300+# GNU Affero General Public License for more details.
301+#
302+# You should have received a copy of the GNU Affero General Public License
303+# along with this program. If not, see <http://www.gnu.org/licenses/>.
304+#
305+##############################################################################
306+
307+import time
308+from report import report_sxw
309+from osv import osv
310+import pooler
311+from tools.amount_to_text import amount_to_text
312+from tools.translate import _
313+
314+class process_report_group(report_sxw.rml_parse):
315+ def __init__(self, cr, uid, name, context):
316+ super(process_report_group, self).__init__(cr, uid, name, context=context)
317+ self.localcontext.update({
318+ 'time': time,
319+ 'get_production_group':self._get_production_group,
320+ })
321+
322+ def _get_production_group(self, data):
323+ res=[]
324+ new_ids=[]
325+ pool = pooler.get_pool(self.cr.dbname)
326+ obj_prod=pool.get('mrp.production')
327+ for prod in obj_prod.browse(self.cr, self.uid, self.ids):
328+ for line in prod.move_lines:
329+ if line.product_id.id in data['product_ids']:
330+ if line.product_id.id not in new_ids:
331+ res.append({'product_id':line.product_id.id,'name':line.product_id.name,'product_uom':line.product_uom.name,'product_qty':line.product_qty,'product_categ':line.product_id.categ_id.name})
332+ new_ids.append(line.product_id.id)
333+ else:
334+ for r in res:
335+ print r,"la errrrrrrr"
336+ if line.product_id.id==521:
337+ print r['product_id'],line.product_id.id
338+ print r['product_qty'],"rer"
339+ print line.product_qty,"line"
340+ if r['product_id']==line.product_id.id:
341+ r['product_qty']+=line.product_qty
342+ if not res:
343+ print line.product_id.id,"primer"
344+ res.append({'product_id':line.product_id.id,'name':line.product_id.name,'product_uom':line.product_uom.name,'product_qty':line.product_qty,'product_categ':line.product_id.categ_id.name})
345+ new_ids.append(line.product_id.id)
346+ """
347+ result={}
348+ for r in res:
349+ result.setdefault(r['product_id'],0)
350+ result[r['product_id']]+= r['product_qty']
351+ print result,"aquisss"
352+ """
353+ return res
354+
355+report_sxw.report_sxw('report.process.report.group','mrp.production','addons/report_process_production/report/process_production_report_group.rml',parser=process_report_group,header=False)
356+
357+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
358+
359
360=== added file 'report_process_production/report/process_production_report_group.rml'
361--- report_process_production/report/process_production_report_group.rml 1970-01-01 00:00:00 +0000
362+++ report_process_production/report/process_production_report_group.rml 2012-09-25 03:45:24 +0000
363@@ -0,0 +1,132 @@
364+<?xml version="1.0"?>
365+<document filename="test.pdf">
366+ <template pageSize="(612.0,792.0)" title="Test" author="Martin Simon" allowSplitting="20">
367+ <pageTemplate id="first">
368+ <frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
369+ </pageTemplate>
370+ </template>
371+ <stylesheet>
372+ <blockTableStyle id="Standard_Outline">
373+ <blockAlignment value="LEFT"/>
374+ <blockValign value="TOP"/>
375+ </blockTableStyle>
376+ <blockTableStyle id="Table1">
377+ <blockAlignment value="LEFT"/>
378+ <blockValign value="TOP"/>
379+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
380+ <lineStyle kind="LINEAFTER" colorName="#000000" start="0,0" stop="0,-1"/>
381+ <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
382+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
383+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
384+ <lineStyle kind="LINEAFTER" colorName="#000000" start="1,0" stop="1,-1"/>
385+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
386+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
387+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
388+ <lineStyle kind="LINEAFTER" colorName="#000000" start="2,0" stop="2,-1"/>
389+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
390+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
391+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
392+ <lineStyle kind="LINEAFTER" colorName="#000000" start="3,0" stop="3,-1"/>
393+ <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
394+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
395+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
396+ <lineStyle kind="LINEAFTER" colorName="#000000" start="4,0" stop="4,-1"/>
397+ <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
398+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
399+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,1" stop="0,-1"/>
400+ <lineStyle kind="LINEAFTER" colorName="#000000" start="0,1" stop="0,-1"/>
401+ <lineStyle kind="LINEABOVE" colorName="#000000" start="0,1" stop="0,1"/>
402+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
403+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,1" stop="1,-1"/>
404+ <lineStyle kind="LINEAFTER" colorName="#000000" start="1,1" stop="1,-1"/>
405+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,1" stop="1,1"/>
406+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
407+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,1" stop="2,-1"/>
408+ <lineStyle kind="LINEAFTER" colorName="#000000" start="2,1" stop="2,-1"/>
409+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,1" stop="2,1"/>
410+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
411+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,1" stop="3,-1"/>
412+ <lineStyle kind="LINEAFTER" colorName="#000000" start="3,1" stop="3,-1"/>
413+ <lineStyle kind="LINEABOVE" colorName="#000000" start="3,1" stop="3,1"/>
414+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
415+ <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,1" stop="4,-1"/>
416+ <lineStyle kind="LINEAFTER" colorName="#000000" start="4,1" stop="4,-1"/>
417+ <lineStyle kind="LINEABOVE" colorName="#000000" start="4,1" stop="4,1"/>
418+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
419+ </blockTableStyle>
420+ <initialize>
421+ <paraStyle name="all" alignment="justify"/>
422+ </initialize>
423+ <paraStyle name="P1" fontName="Helvetica" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
424+ <paraStyle name="P2" fontName="Helvetica-Bold" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
425+ <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
426+ <paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
427+ <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
428+ <paraStyle name="P6" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
429+ <paraStyle name="Standard" fontName="Helvetica"/>
430+ <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
431+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
432+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
433+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
434+ <paraStyle name="Index" fontName="Helvetica"/>
435+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
436+ <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
437+ <paraStyle name="Table Contents" fontName="Helvetica"/>
438+ <images/>
439+ </stylesheet>
440+ <story>
441+ <para style="P2">Reporte De Proceso De Producción Agrupado</para>
442+ <para style="P4">
443+ <font color="white"> </font>
444+ </para>
445+ <para style="P3">
446+ <font color="white"> </font>
447+ </para>
448+ <blockTable colWidths="169.0,72.0,69.0,120.0,69.0" style="Table1">
449+ <tr>
450+ <td>
451+ <para style="P6">Nombre</para>
452+ </td>
453+ <td>
454+ <para style="P6">Cantidad</para>
455+ </td>
456+ <td>
457+ <para style="P6">UOM</para>
458+ </td>
459+ <td>
460+ <para style="P6">Categoria</para>
461+ </td>
462+ <td>
463+ <para style="P6">Reallllll</para>
464+ </td>
465+ </tr>
466+ <tr>
467+ <td>
468+ <para style="P5">[[ repeatIn(get_production_group(data['form'] ), 'p' ) ]]</para>
469+ <para style="P5">[[ p['name'] ]]</para>
470+ </td>
471+ <td>
472+ <para style="P5">[[ p['product_qty'] ]]</para>
473+ </td>
474+ <td>
475+ <para style="P5">[[ p['product_uom'] ]]</para>
476+ </td>
477+ <td>
478+ <para style="P5">[[ p['product_categ'] ]]</para>
479+ </td>
480+ <td>
481+ <para style="P6">
482+ <font color="white"> </font>
483+ </para>
484+ </td>
485+ </tr>
486+ </blockTable>
487+ <para style="P1">
488+ <font color="white"> </font>
489+ </para>
490+ <para style="P1">
491+ <font color="white"> </font>
492+ </para>
493+ </story>
494+</document>
495+
496
497=== added file 'report_process_production/report/process_production_report_group.sxw'
498Binary files report_process_production/report/process_production_report_group.sxw 1970-01-01 00:00:00 +0000 and report_process_production/report/process_production_report_group.sxw 2012-09-25 03:45:24 +0000 differ
499=== added directory 'report_process_production/wizard'
500=== added file 'report_process_production/wizard/__init__.py'
501--- report_process_production/wizard/__init__.py 1970-01-01 00:00:00 +0000
502+++ report_process_production/wizard/__init__.py 2012-09-25 03:45:24 +0000
503@@ -0,0 +1,1 @@
504+import wizard_report_process
505
506=== added file 'report_process_production/wizard/wizard_report_process.py'
507--- report_process_production/wizard/wizard_report_process.py 1970-01-01 00:00:00 +0000
508+++ report_process_production/wizard/wizard_report_process.py 2012-09-25 03:45:24 +0000
509@@ -0,0 +1,92 @@
510+# -*- encoding: utf-8 -*-
511+###########################################################################
512+# Module Writen to OpenERP, Open Source Management Solution
513+#
514+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com/
515+# All Rights Reserved.
516+# info Vauxoo (info@vauxoo.com)
517+############################################################################
518+# Coded by: el_rodo_1 (rodo@vauxoo.com)
519+############################################################################
520+#
521+# This program is free software: you can redistribute it and/or modify
522+# it under the terms of the GNU Affero General Public License as
523+# published by the Free Software Foundation, either version 3 of the
524+# License, or (at your option) any later version.
525+#
526+# This program is distributed in the hope that it will be useful,
527+# but WITHOUT ANY WARRANTY; without even the implied warranty of
528+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
529+# GNU Affero General Public License for more details.
530+#
531+# You should have received a copy of the GNU Affero General Public License
532+# along with this program. If not, see <http://www.gnu.org/licenses/>.
533+#
534+##############################################################################
535+
536+import time
537+
538+from osv import osv, fields
539+from tools.translate import _
540+
541+
542+class wizard_report_process(osv.osv_memory):
543+ _name = 'wizard.report.process'
544+
545+ _columns = {
546+ 'product_ids': fields.many2many('product.product','temp_product_rel','temp_id','product_id','Productos'),
547+ 'group':fields.boolean('Agrupar'),
548+ }
549+
550+ def default_get(self, cr, uid, fields, context=None):
551+ """ To get default values for the object.
552+ @param self: The object pointer.
553+ @param cr: A database cursor
554+ @param uid: ID of the user currently logged in
555+ @param fields: List of fields for which we want default values
556+ @param context: A standard dictionary
557+ @return: A dictionary which of fields with values.
558+ """
559+ if context is None:
560+ context = {}
561+ prod_obj = self.pool.get('product.product')
562+ production_obj = self.pool.get('mrp.production')
563+ res = super(wizard_report_process, self).default_get(cr, uid, fields, context=context)
564+ production_ids = context.get('active_ids', [])
565+ print production_ids,"aqui mira"
566+ if not production_ids:
567+ return res
568+ prod_list=[]
569+ for production in production_obj.browse(cr,uid,production_ids):
570+ for line in production.move_lines:
571+ prod_list.append(line.product_id.id)
572+ res['product_ids']=prod_list
573+ return res
574+
575+
576+ def check_report(self, cr, uid, ids, context=None):
577+ datas = {}
578+ if context is None:
579+ context = {}
580+ data = self.read(cr, uid, ids)[0]
581+
582+ datas = {
583+ 'ids': context.get('active_ids',[]),
584+ 'model': 'wizard.report.process',
585+ 'form': data,
586+ 'uid': uid,
587+ }
588+ if data['group']:
589+ return {
590+ 'type': 'ir.actions.report.xml',
591+ 'report_name': 'process.report.group',
592+ 'datas': datas,
593+ }
594+ else:
595+ return {
596+ 'type': 'ir.actions.report.xml',
597+ 'report_name': 'process.report',
598+ 'datas': datas,
599+ }
600+
601+wizard_report_process()
602
603=== added file 'report_process_production/wizard/wizard_report_process.xml'
604--- report_process_production/wizard/wizard_report_process.xml 1970-01-01 00:00:00 +0000
605+++ report_process_production/wizard/wizard_report_process.xml 2012-09-25 03:45:24 +0000
606@@ -0,0 +1,45 @@
607+<?xml version="1.0" encoding="utf-8"?>
608+<openerp>
609+ <data>
610+
611+
612+ <record id="view_wizard_report_process_form" model="ir.ui.view">
613+ <field name="name">view.wizard.report.process.form</field>
614+ <field name="model">wizard.report.process</field>
615+ <field name="type">form</field>
616+ <field name="arch" type="xml">
617+ <form string="Report Process">
618+ <field name="product_ids" colspan="4" nolabel="1"/>
619+ <newline/>
620+ <field name="group" />
621+ <newline/>
622+ <button special="cancel" string="Cancel" colspan="2" icon="gtk-cancel"/>
623+ <button name="check_report" string="Report" type="object" colspan="1" icon="gtk-execute"/>
624+
625+ </form>
626+ </field>
627+ </record>
628+
629+ <act_window id="wizard_report_process"
630+ name="Reporte Produce"
631+ src_model="mrp.production"
632+ res_model="wizard.report.process"
633+ view_mode="form"
634+ target="new"
635+ key2="client_action_multi"
636+ />
637+
638+ <record id="action_wizard_report_process" model="ir.actions.act_window">
639+ <field name="name">Reporte Proceso</field>
640+ <field name="res_model">wizard.report.process</field>
641+ <field name="type">ir.actions.act_window</field>
642+ <field name="view_type">form</field>
643+ <field name="view_mode">tree,form</field>
644+ <field name="view_id" ref="view_wizard_report_process_form"/>
645+ <!--<field name="context">{'record_id':active_id}</field>-->
646+ <field name="context">{}</field>
647+ <field name="target">new</field>
648+ </record>
649+
650+ </data>
651+</openerp>