Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
l10n_mx
Facturacion
Commits
ed5f8992
Commit
ed5f8992
authored
6 years ago
by
Cuauhtémoc Díaz Minor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(ir.attachment.facturae.mx): black
parent
69dd8b18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
l10n_mx_ir_attachment_facturae/models/ir_attachment_facturae.py
...x_ir_attachment_facturae/models/ir_attachment_facturae.py
+10
-18
No files found.
l10n_mx_ir_attachment_facturae/models/ir_attachment_facturae.py
View file @
ed5f8992
...
...
@@ -543,14 +543,12 @@ class IrAttachmentFacturaeMx(models.Model):
TODO: Cancel outgoing CFDIs
"""
self
.
ensure_one
()
if
self
.
cfdi_type
==
"incoming"
and
self
.
state
in
(
"signed"
,
"done"
,
"waiting"
):
if
self
.
cfdi_type
==
"incoming"
and
self
.
state
in
(
"signed"
,
"done"
,
"waiting"
):
cancel_answer
=
self
.
cancel_cfdi_sat
()
if
cancel_answer
:
self
.
cancel_cfdi
()
elif
cancel_answer
is
None
:
self
.
write
({
"state"
:
"waiting"
,
})
self
.
write
({
"state"
:
"waiting"
})
else
:
self
.
undo_waiting_state
()
return
cancel_answer
...
...
@@ -559,7 +557,7 @@ class IrAttachmentFacturaeMx(models.Model):
def
action_consult_cancellation_status
(
self
):
"""Consult current cfdi cancel status on SAT"""
self
.
ensure_one
()
if
self
.
state
in
(
"waiting"
)
:
if
self
.
state
in
"waiting"
:
consult_answer
=
self
.
consult_cfdi_cancellation_status_sat
()
if
consult_answer
:
self
.
cancel_cfdi
()
...
...
@@ -848,29 +846,24 @@ class IrAttachmentFacturaeMx(models.Model):
# Get all setup PACs in journal
return
record
.
company_id
.
pac_ids
@
api
.
multi
def
undo_waiting_state
(
self
):
'''
when cancel is negate, undo waiting state
'''
"""
when cancel is negate, undo waiting state
"""
self
.
ensure_one
()
if
self
.
state
in
(
"waiting"
)
:
if
self
.
state
in
"waiting"
:
if
self
.
file_pdf
:
self
.
write
({
"state"
:
"done"
})
self
.
write
({
"state"
:
"done"
})
else
:
self
.
write
({
"state"
:
"signed"
})
self
.
write
({
"state"
:
"signed"
})
@
api
.
model
def
cancel_cfdi
(
self
):
'''
Cancel CFDI and rewrite PDF
"""
Cancel CFDI and rewrite PDF
Since we do not generate a new XML
Only generate PDF file
the idea is to overwrite the existing one
'''
"""
record
=
self
.
env
[
self
.
type_attachment
].
browse
(
self
.
res_id
)
data
=
self
.
create_report
(
...
...
@@ -882,10 +875,9 @@ class IrAttachmentFacturaeMx(models.Model):
self
.
write
({
"cfdi_fecha_cancelado"
:
fields
.
Datetime
.
now
(),
"state"
:
"cancel"
})
@
api
.
multi
@
api
.
one
def
validate_cfdi_folio_fiscal
(
self
):
""" Validate an UUID on SAT servers"""
self
.
ensure_one
()
# Webservice parameters
url
=
(
"https://consultaqr.facturaelectronica.sat.gob.mx/ConsultaCFDIService.svc"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment