Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
l10n_ar_padroniibb_import
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aconcagua
l10n_ar_padroniibb_import
Commits
c17fdbb9
Commit
c17fdbb9
authored
6 years ago
by
odoo (anadelia)
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] Bug. Closing cursor in incorrect place
parent
cafffa6f
Branches
7.0
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wizard/padron_import.py
+19
-15
19 additions, 15 deletions
wizard/padron_import.py
with
19 additions
and
15 deletions
wizard/padron_import.py
+
19
−
15
View file @
c17fdbb9
...
...
@@ -252,6 +252,7 @@ class padron_import_(osv.osv_memory):
dbname
=
cr
.
dbname
cursor
=
pooler
.
get_db
(
dbname
).
cursor
()
# Obtengo un nuevo cursor a partir del cursor existente
flag
=
False
for
file_name
in
files_extracted
:
txt_path
=
"'"
+
file_name
+
"'"
if
'
Ret
'
in
file_name
:
...
...
@@ -286,6 +287,7 @@ class padron_import_(osv.osv_memory):
cursor
.
rollback
()
_logger
.
warning
(
'
[ARBA]ERROR: Rollback
'
)
else
:
flag
=
True
cursor
.
commit
()
_logger
.
info
(
'
[ARBA]SUCCESS: Fin de carga de retenciones
'
)
if
'
Per
'
in
file_name
:
...
...
@@ -318,26 +320,28 @@ class padron_import_(osv.osv_memory):
cursor
.
rollback
()
_logger
.
warning
(
'
[ARBA]ERROR: Rollback
'
)
else
:
flag
=
True
cursor
.
commit
()
_logger
.
info
(
'
[ARBA]SUCCESS: Fin de carga de percepciones
'
)
# Mass Update
try
:
mass_wiz_obj
=
self
.
pool
.
get
(
'
padron.mass.update
'
)
mass_wiz_id
=
mass_wiz_obj
.
create
(
cursor
,
uid
,
{
'
arba
'
:
True
,
'
agip
'
:
False
},
context
=
{})
mass_wiz_obj
.
action_update
(
cursor
,
uid
,
[
mass_wiz_id
])
_logger
.
info
(
'
[ARBA] Mass Update Completado
'
)
# Mass Update
if
flag
:
try
:
mass_wiz_obj
=
self
.
pool
.
get
(
'
padron.mass.update
'
)
mass_wiz_id
=
mass_wiz_obj
.
create
(
cursor
,
uid
,
{
'
arba
'
:
True
,
'
agip
'
:
False
},
context
=
{})
mass_wiz_obj
.
action_update
(
cursor
,
uid
,
[
mass_wiz_id
])
except
Exception
,
e
:
_logger
.
exception
(
e
)
raise
e
finally
:
cursor
.
commit
()
_logger
.
info
(
'
[ARBA] Mass Update Completado
'
)
finally
:
rmtree
(
out_path
)
# Delete temp folder
cursor
.
close
()
except
Exception
,
e
:
_logger
.
exception
(
e
)
cursor
.
rollback
()
else
:
cursor
.
commit
()
rmtree
(
out_path
)
# Delete temp folder
cursor
.
close
()
return
True
def
import_zip_file
(
self
,
cr
,
uid
,
ids
,
context
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment