Merge lp:~inddiana/diana-addons/modificacion_diana_supply_control into lp:diana-addons/6.0
- modificacion_diana_supply_control
- Merge into trunk-2
Proposed by
Mauricio Jose Sanchez Puerta
Status: | Merged |
---|---|
Merged at revision: | 22 |
Proposed branch: | lp:~inddiana/diana-addons/modificacion_diana_supply_control |
Merge into: | lp:diana-addons/6.0 |
Diff against target: |
481 lines (+397/-3) 12 files modified
supply_control/__openerp__.py (+5/-0) supply_control/model/diana_supply.py (+5/-0) supply_control/report/__init__.py (+1/-0) supply_control/report/report_sede_suministro.py (+38/-0) supply_control/report/report_sede_suministro.rml (+195/-0) supply_control/report/report_sede_suministro.xml (+16/-0) supply_control/security/group_user_access_suplly.xml (+26/-0) supply_control/security/ir.model.access.csv (+2/-0) supply_control/view/diana_supply_view.xml (+22/-3) supply_control/wizard/__init__.py (+1/-0) supply_control/wizard/wizard_print_report_sede.py (+44/-0) supply_control/wizard/wizard_print_report_sede.xml (+42/-0) |
To merge this branch: | bzr merge lp:~inddiana/diana-addons/modificacion_diana_supply_control |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aristóbulo Meneses | Pending | ||
Review via email: mp+181882@code.launchpad.net |
Commit message
Description of the change
creado grupo para añadir permiso de lectura en las sedes y acceso al wizard
To post a comment you must log in.
- 22. By Mauricio Sanchez <email address hidden>
-
modificado nobre del rml
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'supply_control/__openerp__.py' |
2 | --- supply_control/__openerp__.py 2012-11-08 18:00:55 +0000 |
3 | +++ supply_control/__openerp__.py 2013-08-23 18:56:30 +0000 |
4 | @@ -10,9 +10,14 @@ |
5 | control para la entrega de suministros en Industrias Diana C.A. y realizar la |
6 | impresion de los tickets""", |
7 | "update_xml" : [ |
8 | + 'security/group_user_access_suplly.xml', |
9 | + 'security/ir.model.access.csv', |
10 | 'view/diana_supply_view.xml', |
11 | 'wizard/printers_selection_wizard.xml', |
12 | + 'wizard/wizard_print_report_sede.xml', |
13 | 'report/sisb_supply_lines_report.xml', |
14 | + 'report/report_sede_suministro.xml', |
15 | + |
16 | ], |
17 | "active": False, |
18 | "installable": True, |
19 | |
20 | === modified file 'supply_control/model/diana_supply.py' |
21 | --- supply_control/model/diana_supply.py 2013-06-07 16:17:48 +0000 |
22 | +++ supply_control/model/diana_supply.py 2013-08-23 18:56:30 +0000 |
23 | @@ -271,3 +271,8 @@ |
24 | |
25 | |
26 | diana_supply_printer() |
27 | + |
28 | + |
29 | + |
30 | + |
31 | + |
32 | |
33 | === added file 'supply_control/report/__init__.py' |
34 | --- supply_control/report/__init__.py 1970-01-01 00:00:00 +0000 |
35 | +++ supply_control/report/__init__.py 2013-08-23 18:56:30 +0000 |
36 | @@ -0,0 +1,1 @@ |
37 | +import report_sede_suministro |
38 | |
39 | === added file 'supply_control/report/report_sede_suministro.py' |
40 | --- supply_control/report/report_sede_suministro.py 1970-01-01 00:00:00 +0000 |
41 | +++ supply_control/report/report_sede_suministro.py 2013-08-23 18:56:30 +0000 |
42 | @@ -0,0 +1,38 @@ |
43 | +from report import report_sxw |
44 | +import datetime |
45 | +from datetime import datetime |
46 | + |
47 | +class report_diana_supply_lines(report_sxw.rml_parse): |
48 | + _name = 'report.diana.supply.lines' |
49 | + |
50 | + def __init__(self, cr, uid, name, context): |
51 | + super(report_diana_supply_lines, self).__init__(cr, uid, name, context) |
52 | + self.localcontext.update({ |
53 | + 'get_empresa':self.get_empresa, |
54 | + 'get_final_date':self.get_final_date, |
55 | + }) |
56 | + |
57 | + def get_empresa(self, partner_id): |
58 | + obj_addr = self.pool.get('res.partner.address') |
59 | + addr_id =obj_addr.search(self.cr, self.uid, [('type','=','invoice'),('partner_id','=',partner_id)]) |
60 | + res = {} |
61 | + for row in obj_addr.browse(self.cr, self.uid, addr_id): |
62 | + res = { |
63 | + 'street': row.street, |
64 | + 'phone': row.phone, |
65 | + 'fax': row.fax, |
66 | + 'email': row.email, |
67 | + 'city': row.city, |
68 | + 'name': row.name, |
69 | + 'country': row.country_id.name, |
70 | + } |
71 | + return res |
72 | + |
73 | + def get_final_date(self): |
74 | + return datetime.now().strftime('%d/%m/%Y %H:%M') |
75 | + |
76 | +report_sxw.report_sxw( |
77 | + 'report.sede.suministro', |
78 | + 'diana.supply.lines', |
79 | + 'supply_control/report/report_sede_suministro.rml', |
80 | + parser=report_diana_supply_lines, header=False) |
81 | |
82 | === added file 'supply_control/report/report_sede_suministro.rml' |
83 | --- supply_control/report/report_sede_suministro.rml 1970-01-01 00:00:00 +0000 |
84 | +++ supply_control/report/report_sede_suministro.rml 2013-08-23 18:56:30 +0000 |
85 | @@ -0,0 +1,195 @@ |
86 | +<?xml version="1.0"?> |
87 | +<!DOCTYPE document SYSTEM "rml.dtd" > |
88 | +<document filename="General Ledger_01.pdf"> |
89 | + <header x="10cm" y="10cm"> |
90 | + <template pageSize="(27cm,30cm)" title="ENTREGA DE SUMINISTRO" author="Industrias Diana, C.A. " allowSplitting="20"> |
91 | + <pageTemplate id="cabecera"> |
92 | + <!-- |
93 | + <frame id="reporte" x1="05.0mm" y1="10.0mm" width="253.0mm" height="180mm" /> |
94 | + --> |
95 | + <!-- |
96 | + <frame id="reporte" x1="6cm" y1="6.1cm" width="20cm" height="22.6cm" /> |
97 | + --> |
98 | + <frame id="reporte" x1="0.5cm" y1="6.1cm" width="253.0mm" height="210mm" /> |
99 | + <pageGraphics> |
100 | + <!-- |
101 | + <image x="100" y="750" width="21.06mm" height="21.06mm">[[ company.logo or removeParentNode('image') ]]</image> |
102 | + --> |
103 | + <setFont name="Helvetica-Bold" size="10" /> |
104 | + <stroke color="black" /> |
105 | + <drawString x="100" y="780">[[ company.partner_id.name ]]</drawString> |
106 | + <drawString x="100" y="765">[[ company.partner_id.vat[2:] or '']]</drawString> |
107 | + <drawString x="630" y="780">Valencia, [[ get_final_date() ]]</drawString> |
108 | + <drawCentredString x="700" y="800"> |
109 | + Pag. |
110 | + <pageNumber style="estilo2" /> |
111 | + </drawCentredString> |
112 | + <drawString x="10mm" y="5mm"> |
113 | + SISB / [[ user.login ]] / Fecha de Impresion: [[formatLang(time.strftime('%Y-%m-%d'),date=True)]] [[time.strftime('%H:%m')]] / Pagina: |
114 | + <pageNumber /> |
115 | + </drawString> |
116 | + </pageGraphics> |
117 | + </pageTemplate > |
118 | + </template> |
119 | + </header> |
120 | + <stylesheet> |
121 | + <paraStyle name="estilo1_a" fontName="Helvetica" alignment="JUSTIFY" fontSize="8.0" /> |
122 | + <paraStyle name="estilo1" fontName="Helvetica" alignment="JUSTIFY" /> |
123 | + <paraStyle name="estilo2" fontName="Helvetica-bold" alignment="CENTER" fontSize="10.0" /> |
124 | + <paraStyle name="estilo3" fontName="Helvetica" alignment="CENTER" fontSize="8.0" /> |
125 | + <paraStyle name="estilo3_a" fontName="Helvetica-bold" alignment="CENTER" fontSize="8.0" /> |
126 | + <paraStyle name="estilo4" fontName="Helvetica" alignment="CENTER" fontSize="6.0" leading="8.0" /> |
127 | + <paraStyle name="estilo5" fontName="Helvetica" alignment="CENTER" fontSize="6.0" leading="8.0" /> |
128 | + <paraStyle name="estilo6" fontName="Helvetica-bold" alignment="LEFT" fontSize="8.0" leading="8.0" /> |
129 | + <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" /> |
130 | + <paraStyle name="terp_default_Centre_7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" /> |
131 | + <blockTableStyle id="Standard_Outline"> |
132 | + <blockAlignment value="LEFT" /> |
133 | + <blockValign value="TOP" /> |
134 | + </blockTableStyle> |
135 | + <blockTableStyle id="Table1"> |
136 | + <blockAlignment value="LEFT" /> |
137 | + <blockValign value="TOP" /> |
138 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1" /> |
139 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0" /> |
140 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1" /> |
141 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1" /> |
142 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0" /> |
143 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1" /> |
144 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1" /> |
145 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0" /> |
146 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1" /> |
147 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1" /> |
148 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0" /> |
149 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1" /> |
150 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1" /> |
151 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0" /> |
152 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1" /> |
153 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="5,0" stop="5,-1" /> |
154 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0" /> |
155 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1" /> |
156 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="6,0" stop="6,-1" /> |
157 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="6,0" stop="6,-1" /> |
158 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="6,0" stop="6,0" /> |
159 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1" /> |
160 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="7,0" stop="7,0" /> |
161 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="6,0" stop="7,-1" /> |
162 | + </blockTableStyle> |
163 | + <blockTableStyle id="Table2"> |
164 | + <blockAlignment value="LEFT" /> |
165 | + <blockValign value="TOP" /> |
166 | + <lineStyle kind="GRID" colorName="#000000" /> |
167 | + </blockTableStyle> |
168 | + <blockTableStyle id="Tabla11_b"> |
169 | + <blockAlignment value="LEFT" /> |
170 | + <blockValign value="TOP" /> |
171 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="11,0" /> |
172 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="0,1" stop="11,1" /> |
173 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1" /> |
174 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1" /> |
175 | + </blockTableStyle> |
176 | + <blockTableStyle id="Tabla12"> |
177 | + <blockAlignment value="LEFT" /> |
178 | + <blockValign value="TOP" /> |
179 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0" /> |
180 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1" /> |
181 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1" /> |
182 | + <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1" /> |
183 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="1,0" stop="1,-1" /> |
184 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0" /> |
185 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="2,0" stop="2,-1" /> |
186 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1" /> |
187 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0" /> |
188 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="3,0" stop="3,-1" /> |
189 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0" /> |
190 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1" /> |
191 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="4,0" stop="4,-1" /> |
192 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0" /> |
193 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1" /> |
194 | + <lineStyle kind="LINEAFTER" colorName="#000000" start="5,0" stop="5,-1" /> |
195 | + <setNextTemplate name="first" /> |
196 | + <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0" /> |
197 | + <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="5,-1" /> |
198 | + </blockTableStyle> |
199 | + <!-- |
200 | + <condPageBreak/> |
201 | + --> |
202 | + </stylesheet> |
203 | + <story> |
204 | + <pto> |
205 | + <pto_header> |
206 | +<!-- |
207 | + <para>[[repeatIn(data['form']['salida'],'o')]]</para> |
208 | +--> |
209 | + <blockTable colWidths="750"> |
210 | + <tr> |
211 | + <td> |
212 | + <para style="terp_header_Centre">ENTREGA DE SUMINISTRO</para> |
213 | + </td> |
214 | + </tr> |
215 | + </blockTable> |
216 | + <spacer length="0.5cm" /> |
217 | + <blockTable colWidths="90, 115, 130, 140" style="Table2"> |
218 | + <tr> |
219 | + <td> |
220 | + <para style="estilo3_a">FECHA</para> |
221 | + </td> |
222 | + <td> |
223 | + <para style="estilo3_a">CODIGO</para> |
224 | + </td> |
225 | + <td> |
226 | + <para style="estilo3_a">NOMBRE y APELLIDO</para> |
227 | + </td> |
228 | + <td> |
229 | + <para style="estilo3_a">FIRMA</para> |
230 | + </td> |
231 | + </tr> |
232 | + </blockTable> |
233 | + </pto_header> |
234 | + |
235 | + <blockTable colWidths="750"> |
236 | + <tr> |
237 | + <td> |
238 | + <para style="terp_header_Centre">ENTREGA DE SUMINISTRO</para> |
239 | + </td> |
240 | + </tr> |
241 | + </blockTable> |
242 | + <spacer length="0.5cm" /> |
243 | + <blockTable colWidths="90, 115, 130, 140" style="Table2"> |
244 | + <tr> |
245 | + <td> |
246 | + <para style="estilo3_a">FECHA</para> |
247 | + </td> |
248 | + <td> |
249 | + <para style="estilo3_a">CODIGO</para> |
250 | + </td> |
251 | + <td> |
252 | + <para style="estilo3_a">NOMBRE y APELLIDO</para> |
253 | + </td> |
254 | + <td> |
255 | + <para style="estilo3_a">FIRMA</para> |
256 | + </td> |
257 | + </tr> |
258 | + |
259 | + </blockTable> |
260 | + <blockTable colWidths="90, 115, 130, 140" style="Table2"> |
261 | + |
262 | + <tr> |
263 | + <para>[[repeatIn(data['form']['salida'],'o')]]</para> |
264 | + <td> |
265 | + <para style="estilo3_a">[[formatLang(o['fecha'], date=True)]]</para> |
266 | + </td> |
267 | + <td> |
268 | + <para style="estilo3_a">[[ o['cod'] ]]</para> |
269 | + </td> |
270 | + <td> |
271 | + <para style="estilo3_a">[[ o['name'] ]]</para> |
272 | + </td> |
273 | + <td> |
274 | + <para style="estilo3_a" /> |
275 | + </td> |
276 | + </tr> |
277 | + </blockTable> |
278 | + </pto> |
279 | + </story> |
280 | +</document> |
281 | |
282 | === added file 'supply_control/report/report_sede_suministro.xml' |
283 | --- supply_control/report/report_sede_suministro.xml 1970-01-01 00:00:00 +0000 |
284 | +++ supply_control/report/report_sede_suministro.xml 2013-08-23 18:56:30 +0000 |
285 | @@ -0,0 +1,16 @@ |
286 | +<?xml version="1.0" encoding="utf-8"?> |
287 | +<openerp> |
288 | + <data> |
289 | + |
290 | + <report auto="True" |
291 | + id="supply_lines_sede_report" |
292 | + model="wizard.print.report.sede" |
293 | + name="sede.suministro" |
294 | + string="Reporte de Suministro por sede" |
295 | + menu="True" |
296 | + file="supply_control/report/report_sede_suministro.rml" |
297 | + /> |
298 | + |
299 | + </data> |
300 | +</openerp> |
301 | + |
302 | |
303 | === added directory 'supply_control/security' |
304 | === added file 'supply_control/security/group_user_access_suplly.xml' |
305 | --- supply_control/security/group_user_access_suplly.xml 1970-01-01 00:00:00 +0000 |
306 | +++ supply_control/security/group_user_access_suplly.xml 2013-08-23 18:56:30 +0000 |
307 | @@ -0,0 +1,26 @@ |
308 | +<?xml version="1.0" encoding="utf-8"?> |
309 | +<openerp> |
310 | + <data noupdate="1"> |
311 | + |
312 | +<!-- |
313 | + Grupos de suplly control |
314 | +--> |
315 | + |
316 | + |
317 | + <record id="group_supply_manager" model="res.groups"> |
318 | + <field name="name">supply / Manager</field> |
319 | + </record> |
320 | + |
321 | + |
322 | + <record id="group_hr_sede_view" model="res.groups"> |
323 | + <field name="name">hr_sede / asigd</field> |
324 | + </record> |
325 | + |
326 | +<!-- |
327 | + Menu de Anticipos |
328 | +--> |
329 | + |
330 | + |
331 | + |
332 | + </data> |
333 | +</openerp> |
334 | |
335 | === added file 'supply_control/security/ir.model.access.csv' |
336 | --- supply_control/security/ir.model.access.csv 1970-01-01 00:00:00 +0000 |
337 | +++ supply_control/security/ir.model.access.csv 2013-08-23 18:56:30 +0000 |
338 | @@ -0,0 +1,2 @@ |
339 | +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
340 | +"acces_wizard_print_repor_sede_print","wizard.print.report.sede.form","sisb_nomina.model_hr_sede","group_hr_sede_view",1,0,0,0 |
341 | |
342 | === modified file 'supply_control/view/diana_supply_view.xml' |
343 | --- supply_control/view/diana_supply_view.xml 2012-11-08 18:00:55 +0000 |
344 | +++ supply_control/view/diana_supply_view.xml 2013-08-23 18:56:30 +0000 |
345 | @@ -73,9 +73,28 @@ |
346 | <field name="arch" type="xml"> |
347 | <search string="Search Supply State"> |
348 | <group col='10' colspan='4'> |
349 | - <filter name='draft' icon="terp-document-new" string="Draft" domain="[('state','=','Draft')]" /> |
350 | - <filter name='delivered' icon="terp-camera_test" string="Delivered" domain="[('state','=','Delivered')]" /> |
351 | - <filter name='expired' icon="terp-dialog-close" string="Expired" domain="[('state','=','Expired')]" /> |
352 | + <filter icon="terp-document-new" string="Draft" domain="[('state','=','Draft')]" /> |
353 | + <filter icon="terp-camera_test" string="Delivered" domain="[('state','=','Delivered')]" /> |
354 | + <filter icon="terp-dialog-close" string="Expired" domain="[('state','=','Expired')]" /> |
355 | +<!-- |
356 | + <filter icon="terp-dialog-close" string="Sede" domain="[( 'employee_id.hr_sede_id', '=', '1' )]" /> |
357 | +--> |
358 | + <newline /> |
359 | + <filter icon="terp-document-new" string="PLANTA VALENCIA" domain="[( 'employee_id.hr_sede_id.id' , '=', '1' )]" /> |
360 | + <filter icon="terp-document-new" string="TUREN" domain="[( 'employee_id.hr_sede_id.id' , '=', '2' )]" /> |
361 | + <filter icon="terp-document-new" string="COMISION DE ENLACE" domain="[( 'employee_id.hr_sede_id.id' , '=', '4' )]" /> |
362 | +<!-- |
363 | + <newline /> |
364 | +--> |
365 | + <filter icon="terp-document-new" string="ABASTOS VENEZUELA" domain="[( 'employee_id.hr_sede_id.id' , '=', '5' )]" /> |
366 | + <filter icon="terp-document-new" string="CENT. DE DIST. MARACAIBO" domain="[( 'employee_id.hr_sede_id.id' , '=', '6' )]" /> |
367 | + <filter icon="terp-document-new" string="CENT. DE DIST. BARQUISIMETO" domain="[( 'employee_id.hr_sede_id.id' , '=', '8' )]" /> |
368 | +<!-- |
369 | + <newline /> |
370 | +--> |
371 | + <filter icon="terp-document-new" string="CENT. DIST. SAN CRISTOBAL" domain="[( 'employee_id.hr_sede_id.id' , '=', '11' )]" /> |
372 | + <filter icon="terp-document-new" string="CENT. DE DIST. CARACAS" domain="[( 'employee_id.hr_sede_id.id', '=', '12' )]" /> |
373 | + <filter icon="terp-document-new" string="CENT. DE DIST. VALENCIA" domain="[( 'employee_id.hr_sede_id.id', '=', '13' )]" /> |
374 | <newline /> |
375 | <field name="name"/> |
376 | <field name="employee_code"/> |
377 | |
378 | === modified file 'supply_control/wizard/__init__.py' |
379 | --- supply_control/wizard/__init__.py 2012-11-08 18:00:55 +0000 |
380 | +++ supply_control/wizard/__init__.py 2013-08-23 18:56:30 +0000 |
381 | @@ -19,3 +19,4 @@ |
382 | |
383 | |
384 | import printers_selection_wizard |
385 | +import wizard_print_report_sede |
386 | |
387 | === added file 'supply_control/wizard/wizard_print_report_sede.py' |
388 | --- supply_control/wizard/wizard_print_report_sede.py 1970-01-01 00:00:00 +0000 |
389 | +++ supply_control/wizard/wizard_print_report_sede.py 2013-08-23 18:56:30 +0000 |
390 | @@ -0,0 +1,44 @@ |
391 | +#!/usr/bin/env python |
392 | +# -*- coding: utf-8 -*-- |
393 | + |
394 | +from time import strftime |
395 | +from datetime import datetime |
396 | +from datetime import date |
397 | +from datetime import timedelta |
398 | +import calendar |
399 | +from dateutil.relativedelta import * |
400 | +from osv import fields, osv |
401 | +import unicodedata |
402 | + |
403 | +class wizard_print_repor_sede(osv.osv_memory): |
404 | + _name = 'wizard.print.report.sede' |
405 | + _description = 'Wizar para imprimir reportes de las lineas de suministros' |
406 | + |
407 | + |
408 | + def imprimir(self, cr, uid, ids, context=None): |
409 | + act_id = context['active_ids'] |
410 | + diana_supply_lines_obj = self.pool.get('diana.supply.lines') |
411 | + diana_supply_lines_brw = diana_supply_lines_obj.browse(cr, uid, act_id) |
412 | + data = {'form':{'salida':[]}} |
413 | + diana_supply_lines_id = [i.id for i in diana_supply_lines_brw if i.state == 'Draft'] |
414 | + now = date.today() |
415 | + now_str = str(now) |
416 | + |
417 | + if not diana_supply_lines_id: |
418 | + raise osv.except_osv('ERROR', 'No hay suministros en estado borrador') |
419 | + |
420 | + diana_supply_lines_write = diana_supply_lines_obj.write(cr, uid, diana_supply_lines_id, {'delivery_date': now_str, 'state': 'Delivered', 'delivered': True, 'expiration_date': None, 'print_verify': True}) |
421 | + diana_supply_lines_brw = diana_supply_lines_obj.browse(cr, uid, diana_supply_lines_id) |
422 | + |
423 | + for i in diana_supply_lines_brw: |
424 | + data['form']['salida'].append({'fecha':i.delivery_date, 'cod':i.employee_id.cod_number, 'name':i.employee_id.name}) |
425 | + |
426 | + #~ print data |
427 | + |
428 | + return { |
429 | + 'type': 'ir.actions.report.xml', |
430 | + 'report_name': 'sede.suministro', |
431 | + 'datas': data, |
432 | + } |
433 | + |
434 | +wizard_print_repor_sede() |
435 | |
436 | === added file 'supply_control/wizard/wizard_print_report_sede.xml' |
437 | --- supply_control/wizard/wizard_print_report_sede.xml 1970-01-01 00:00:00 +0000 |
438 | +++ supply_control/wizard/wizard_print_report_sede.xml 2013-08-23 18:56:30 +0000 |
439 | @@ -0,0 +1,42 @@ |
440 | +<?xml version="1.0" encoding="utf-8"?> |
441 | +<openerp> |
442 | + <data> |
443 | + |
444 | +<!-- |
445 | +Printer Selection |
446 | +--> |
447 | + |
448 | + |
449 | + <record id="wizard_print_repor_sede_print" model="ir.ui.view"> |
450 | + <field name="name">wizard.print.report.sede.form</field> |
451 | + <field name="model">wizard.print.report.sede</field> |
452 | + <field name="type">form</field> |
453 | + <field name="arch" type="xml"> |
454 | + <form string="Imprimir Reporte"> |
455 | + <group colspan = "2" col = "5"> |
456 | + <hpaned/> |
457 | + <button icon = "gtk-cancel" special = "cancel" string = "Cancel"/> |
458 | + <hpaned/> |
459 | + <button icon = "gtk-print" name = "imprimir" string = "Print" type = "object"/> |
460 | + <hpaned/> |
461 | + </group> |
462 | + </form> |
463 | + </field> |
464 | + </record> |
465 | + |
466 | + |
467 | + <act_window name="Entregar por listado" |
468 | + res_model="wizard.print.report.sede" |
469 | + src_model="diana.supply.lines" |
470 | + key2="client_action_multi" |
471 | + multi="True" |
472 | + view_mode="form" |
473 | + view_type="form" |
474 | + target="new" |
475 | + id="action_wizard_print_repor_sede_print" |
476 | + groups="supply_control.group_supply_manager"/> |
477 | + |
478 | + |
479 | + </data> |
480 | +</openerp> |
481 | + |