Merge lp://staging/~altegra/openerp-mexico-localization/l10n_facturae_addons_path-dev-eric into lp://staging/openerp-mexico-localization

Status: Merged
Merged at revision: 168
Proposed branch: lp://staging/~altegra/openerp-mexico-localization/l10n_facturae_addons_path-dev-eric
Merge into: lp://staging/openerp-mexico-localization
Diff against target: 32 lines (+13/-3)
1 file modified
l10n_mx_facturae/invoice.py (+13/-3)
To merge this branch: bzr merge lp://staging/~altegra/openerp-mexico-localization/l10n_facturae_addons_path-dev-eric
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Isaac López Zúñiga Pending
Review via email: mp+111115@code.staging.launchpad.net

Description of the change

Se corrige el error de no encontrar el archivo cadenaoriginal_2_0_l al generar una factura, esto debido a que anteriormente tomaba el Path completo del archivo .conf en lugar de "dividir" los paths cuando estos son mas de uno.

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

Eric,
Gracias por la propuesta de merge.

Disculpa, cual es el número de bug, que estás corrigiendo aquí

Si no hay bug, te recomiendo publicar el bug que realiza la versión actual, para tenerlo documentado y tener referencia de la descripción completa del bug.

Revision history for this message
Eric Hernández - http://www.grupoaltegra.com (daimon) wrote :

Según yo publiqué un blue print por que no es un bug, aqui esta el Blue
Print:

https://blueprints.launchpad.net/openerp-mexico-localization/+spec/addons-path-facturae

El 19 de junio de 2012 18:02, Moisés López - http://www.vauxoo.com <
<email address hidden>> escribió:

> Eric,
> Gracias por la propuesta de merge.
>
> Disculpa, cual es el número de bug, que estás corrigiendo aquí
>
> Si no hay bug, te recomiendo publicar el bug que realiza la versión
> actual, para tenerlo documentado y tener referencia de la descripción
> completa del bug.
> --
>
> https://code.launchpad.net/~grupoaltegra/openerp-mexico-localization/l10n_facturae_addons_path-dev-eric/+merge/111115
> You proposed
> lp:~grupoaltegra/openerp-mexico-localization/l10n_facturae_addons_path-dev-eric
> for merging.
>

--
IE Edilberto Eric Hernandez Martinez
Desarrollo de Proyectos
+52 (771) 185 89 13

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Hola Eric.

Excelente, fijate algo, para que quede enlazado si es un bug lo linkeas e la ventana del bug, si es un bluprint es lo mismo......

Ya lo hice verifica como se ve ahora tu blueprint.

Saludos.

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Fijate como aparece ahora el blueprint enlazado.

Saludos.

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

Eric,
Ahora sí entiendo el tema que estás proponiendo mejorar.

Ya lo veo, voy a hacer un par de ajustes, para mergealo.
Por ejemplo,

Si tu utilizas
tools.config["addons_path"].split(",")
No necesitas validar si tiene una coma o no, si no la tiene la iteración será de tamaño 1, si sí tiene una o N comas, las iteraciones serán N+1 iteraciones.

¿Me explico?

Revision history for this message
Eric Hernández - http://www.grupoaltegra.com (daimon) wrote :

Moy,

Entiendo, ahora la pregunta es: ¿lo corrijo yo y vuelvo a hacer una propuesta de merge? o si lo corrijo y hago "push" ¿es suficiente? y seguimos con esta misma propuesta, o lo corriges tu?

Gracias

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :
Download full text (3.2 KiB)

Ok, si quieres hazlo tú.
Mira aquí ya tenía una parte avanzada.
Aplícate este parche en tu branch local, pruébalo, hazle tus ajustes, haber que te parece.

=== modified file 'l10n_mx_facturae/invoice.py'
--- l10n_mx_facturae/invoice.py 2012-06-19 22:31:16 +0000
+++ l10n_mx_facturae/invoice.py 2012-06-22 17:16:13 +0000
@@ -375,32 +375,23 @@
                 file_globals['fname_key_no_pem'] = fname_key_no_pem

                 file_globals['password'] = certificate_id.certificate_password
-
+ real_path = None
                 if certificate_id.fname_xslt:
                     if ( certificate_id.fname_xslt[0] == os.sep or certificate_id.fname_xslt[1] == ':' ):
                         file_globals['fname_xslt'] = certificate_id.fname_xslt
                     else:
                         file_globals['fname_xslt'] = os.path.join( tools.config["root_path"], certificate_id.fname_xslt )
                 else:
- # Se busca el caracter "," en el addons_path
- if "," in tools.config["addons_path"]:
- # Si existe la coma tenemos varios paths en esa variable y debemos identificar todos
- all_paths = tools.config["addons_path"].split(",")
- # Para cada uno verificamos la existencia del archivo que requerimos
- real_path = ""
- for my_path in all_paths:
- file_globals['fname_xslt'] = os.path.join( my_path, 'l10n_mx_facturae', 'SAT', 'cadenaoriginal_2_0_l.xslt' )
- if os.path.isfile(file_globals.get('fname_xslt', ' ')):
- # Si el archivo esta en este Path lo guardamos en real_path
- real_path = my_path
- break
- else:
- file_globals['fname_xslt'] = os.path.join( tools.config["addons_path"], 'l10n_mx_facturae', 'SAT', 'cadenaoriginal_2_0_l.xslt' )
-
- if realpath != "":
- file_globals['fname_repmensual_xslt'] = os.path.join( real_path, 'l10n_mx_facturae', 'SAT', 'reporte_mensual_2_0.xslt' )
- else:
- file_globals['fname_repmensual_xslt'] = os.path.join( tools.config["addons_path"], 'l10n_mx_facturae', 'SAT', 'reporte_mensual_2_0.xslt' )
+ #Search char "," for addons_path, now is multi-path
+ all_paths = tools.config["addons_path"].split(",")
+ for my_path in all_paths:
+ file_globals['fname_xslt'] = os.path.join( my_path, 'l10n_mx_facturae', 'SAT', 'cadenaoriginal_2_0_l.xslt' )
+ if os.path.isfile(file_globals.get('fname_xslt', ' ')):
+ #If file is in path, save it on real_path
+ real_path = my_path
+ break
+
+ file_globals['fname_repmensual_xslt'] = real_path and os.path.join( real_path, 'l10n_mx_facturae', 'SAT', 'reporte_mensual_2_0.xslt' ) or ''

                 if not f...

Read more...

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :
Download full text (3.7 KiB)

Si Eric.

Solo haces un Push, y haces el comentario de READY! (El push no envía
mails-)

Saludos GOOD Job Guys!

2012/6/22 Moisés López - http://www.vauxoo.com <email address hidden>

> Ok, si quieres hazlo tú.
> Mira aquí ya tenía una parte avanzada.
> Aplícate este parche en tu branch local, pruébalo, hazle tus ajustes,
> haber que te parece.
>
> === modified file 'l10n_mx_facturae/invoice.py'
> --- l10n_mx_facturae/invoice.py 2012-06-19 22:31:16 +0000
> +++ l10n_mx_facturae/invoice.py 2012-06-22 17:16:13 +0000
> @@ -375,32 +375,23 @@
> file_globals['fname_key_no_pem'] = fname_key_no_pem
>
> file_globals['password'] =
> certificate_id.certificate_password
> -
> + real_path = None
> if certificate_id.fname_xslt:
> if ( certificate_id.fname_xslt[0] == os.sep or
> certificate_id.fname_xslt[1] == ':' ):
> file_globals['fname_xslt'] =
> certificate_id.fname_xslt
> else:
> file_globals['fname_xslt'] = os.path.join(
> tools.config["root_path"], certificate_id.fname_xslt )
> else:
> - # Se busca el caracter "," en el addons_path
> - if "," in tools.config["addons_path"]:
> - # Si existe la coma tenemos varios paths en esa
> variable y debemos identificar todos
> - all_paths = tools.config["addons_path"].split(",")
> - # Para cada uno verificamos la existencia del
> archivo que requerimos
> - real_path = ""
> - for my_path in all_paths:
> - file_globals['fname_xslt'] = os.path.join(
> my_path, 'l10n_mx_facturae', 'SAT', 'cadenaoriginal_2_0_l.xslt' )
> - if
> os.path.isfile(file_globals.get('fname_xslt', ' ')):
> - # Si el archivo esta en este Path lo
> guardamos en real_path
> - real_path = my_path
> - break
> - else:
> - file_globals['fname_xslt'] = os.path.join(
> tools.config["addons_path"], 'l10n_mx_facturae', 'SAT',
> 'cadenaoriginal_2_0_l.xslt' )
> -
> - if realpath != "":
> - file_globals['fname_repmensual_xslt'] = os.path.join(
> real_path, 'l10n_mx_facturae', 'SAT', 'reporte_mensual_2_0.xslt' )
> - else:
> - file_globals['fname_repmensual_xslt'] = os.path.join(
> tools.config["addons_path"], 'l10n_mx_facturae', 'SAT',
> 'reporte_mensual_2_0.xslt' )
> + #Search char "," for addons_path, now is multi-path
> + all_paths = tools.config["addons_path"].split(",")
> + for my_path in all_paths:
> + file_globals['fname_xslt'] = os.path.join(
> my_path, 'l10n_mx_facturae', 'SAT', 'cadenaoriginal_2_0_l.xslt' )
> + if os.path.isfile(file_globals.get('fname_xslt',
> ' ')):
> + #If file is in path, save it on real_path
> + real_path =...

Read more...

169. By Eric Hernandez <<email address hidden>

[REF] Code cleaner, more usable code !

Revision history for this message
Eric Hernández - http://www.grupoaltegra.com (daimon) wrote :

Listo, código mas limpio según las recomendaciones del Moy xD

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

Yo lo veo ahora bien.
Muchas gracias Eric por el aporte.

Te comento que yo lo veo muy bien el cambio, ahora falta que Isaac le haga un par de pruebas unitarias para aplicar el merge por completo.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.