Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
tpv_correcciones
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit eeb94065
authored
2021-10-08 10:29:19 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
se agrega correccion cae
1 parent
6b720b66
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
models/comprobante.py
security/permisos.xml
views/comprobante.xml
wizard/generar_nota.py
models/comprobante.py
View file @
eeb9406
...
...
@@ -2,7 +2,7 @@
from
odoo
import
models
,
fields
,
api
,
exceptions
from
.qr
import
qrfiscal
from
odoo.exceptions
import
UserError
,
ValidationError
,
Warning
,
RedirectWarning
import
base64
import
base64
,
datetime
class
asw_comprobante
(
models
.
Model
):
_inherit
=
'asw.comprobante'
...
...
@@ -150,3 +150,18 @@ class asw_comprobante(models.Model):
'target'
:
'new'
,
}
def
CorrejirFacturaSinCAE
(
self
):
if
not
self
.
env
.
user
.
has_group
(
"tpv_correcciones.module_category_tpv_corrector_electronica_admin"
):
raise
Warning
(
"No tenes permiso para correjir facturas"
)
if
self
.
comp_talonario
.
tal_es_fe
==
False
:
raise
Warning
(
"No es factura electronica, no puedo hacer nada"
)
if
not
self
.
afip_auth_code_due
==
False
:
raise
Warning
(
"Esta factura ya fue Autorizada en AFIP, si no ves el CAE, por favor reporte a soporte"
)
estado_actual
=
self
.
comp_estado
#guardo el estado por si fue abonada
self
.
comp_estado
=
"b"
#la dejo en borrador
self
.
comp_fecha
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
self
.
validar
()
#revalido en este punto si falla se cancela todo el proceso
self
.
comp_estado
=
estado_actual
#le dejo el estado original
\ No newline at end of file
security/permisos.xml
View file @
eeb9406
...
...
@@ -6,7 +6,12 @@
</record>
<record
model=
"res.groups"
id=
"module_category_tpv_corrector_tal_admin"
>
<field
name=
"name"
>
Administrador
</field>
<field
name=
"name"
>
Puede ajustar talonario
</field>
<field
name=
"category_id"
eval=
"ref('module_category_tpv_corrector_tal')"
/>
</record>
<record
model=
"res.groups"
id=
"module_category_tpv_corrector_electronica_admin"
>
<field
name=
"name"
>
Puede correjir facturas sin cae
</field>
<field
name=
"category_id"
eval=
"ref('module_category_tpv_corrector_tal')"
/>
</record>
...
...
views/comprobante.xml
View file @
eeb9406
...
...
@@ -47,7 +47,7 @@
<field
name=
"arch"
type=
"xml"
>
<data>
<xpath
expr=
"//field[@name='afip_xml_response']"
position=
"after"
>
<
!--<field name="qr" />--
>
<
button
name=
"CorrejirFacturaSinCAE"
class=
"btn btn-warning"
string=
"Correjir cae"
type=
"object"
colspam=
"2"
/
>
<field
name=
"referencia_orig_fact"
/>
<field
name=
"referencia_orig_ptv"
/>
<field
name=
"referencia_orig_numero"
/>
...
...
wizard/generar_nota.py
View file @
eeb9406
...
...
@@ -17,7 +17,7 @@ class tpv_generar_nota(models.TransientModel):
comprobante
=
self
.
gn_comprobante
referencia
=
'Reintegro del comprobante : '
+
comprobante
.
comp_talonario
.
tal_codigo
+
"/"
+
comprobante
.
comp_nro_letras
talonario
=
self
.
env
[
'asw.talonario'
]
.
search
([(
'tal_pto_vta'
,
'='
,
comprobante
.
comp_talonario
.
tal_pto_vta
),(
'tal_letra'
,
'='
,
comprobante
.
comp_talonario
.
tal_letra
),(
'tal_codigo'
,
'='
,
'NCRED'
)])
talonario
=
self
.
env
[
'asw.talonario'
]
.
search
([(
'tal_pto_vta'
,
'='
,
comprobante
.
comp_talonario
.
tal_pto_vta
),(
'tal_letra'
,
'='
,
comprobante
.
comp_talonario
.
tal_letra
),(
'tal_codigo'
,
'='
,
'NCRED'
)])
#es variable mover a preferecias
if
talonario
:
contra_comprobante
=
self
.
generar_comprobante
(
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment