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
l10n_mx_facturae
Commits
d3d2764a
Commit
d3d2764a
authored
6 years ago
by
agb80
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(flake): actualiza los estilos para cumplir con flake
parent
bb8d90d0
Pipeline
#5836
passed with stage
in 1 minute and 8 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
l10n_mx_facturae/data/ir_cron.xml
l10n_mx_facturae/data/ir_cron.xml
+2
-1
l10n_mx_facturae/migrations/2.8.0/post-migration.py
l10n_mx_facturae/migrations/2.8.0/post-migration.py
+8
-8
l10n_mx_facturae/models/account_invoice.py
l10n_mx_facturae/models/account_invoice.py
+7
-8
No files found.
l10n_mx_facturae/data/ir_cron.xml
View file @
d3d2764a
...
...
@@ -12,4 +12,5 @@
<field
name=
"active"
eval=
"False"
/>
</record>
</data>
</openerp>
\ No newline at end of file
</openerp>
This diff is collapsed.
Click to expand it.
l10n_mx_facturae/migrations/2.8.0/post-migration.py
View file @
d3d2764a
...
...
@@ -11,17 +11,17 @@ _logger = logging.getLogger(__name__)
def
compute_cfdi_id
(
env
):
ir_attachment_mx_obj
=
env
[
"
ir.attachment.facturae.mx
"
]
invoices
=
env
[
"
account.invoice
"
].
search
([(
"
state
"
,
"
in
"
,
[
"
open
"
,
"
paid
"
])])
_logger
.
info
(
"invoices to set cfdi_id: "
+
str
(
len
(
invoices
)))
"""Update reference to `ir.attachment.facturae.mx` for invoices"""
ir_attachment_mx_obj
=
env
[
'
ir.attachment.facturae.mx
'
]
invoices
=
env
[
'
account.invoice
'
].
search
([(
'
state
'
,
'
in
'
,
[
'
open
'
,
'
paid
'
])])
_logger
.
info
(
'Updating reference for cfdi on '
+
str
(
len
(
invoices
))
+
' invoices'
)
for
invoice
in
invoices
:
related_attachment
=
ir_attachment_mx_obj
.
search
(
[
(
"
res_id
"
,
"="
,
invoice
.
id
),
(
"
type_attachment
"
,
"="
,
"
account.invoice
"
),
(
"
company_id
"
,
"="
,
invoice
.
company_id
.
id
),
(
"
state
"
,
"
in
"
,
[
"
signed
"
,
"
done
"
]),
(
'
res_id
'
,
'='
,
invoice
.
id
),
(
'
type_attachment
'
,
'='
,
'
account.invoice
'
),
(
'
company_id
'
,
'='
,
invoice
.
company_id
.
id
),
(
'
state
'
,
'
in
'
,
[
'
signed
'
,
'
done
'
]),
]
)
if
related_attachment
:
...
...
This diff is collapsed.
Click to expand it.
l10n_mx_facturae/models/account_invoice.py
View file @
d3d2764a
...
...
@@ -199,7 +199,7 @@ class AccountInvoice(models.Model):
@
api
.
model
def
cron_invoices_pending_to_cancel
(
self
):
invoices
=
self
.
env
[
'account.invoice'
].
search
(
invoices
=
self
.
env
[
'account.invoice'
].
search
(
[
(
'state'
,
'in'
,
[
'waiting'
])
]
...
...
@@ -294,9 +294,9 @@ class AccountInvoice(models.Model):
):
cancelacion
=
account_invoice
.
cancel_cfdi
()[
0
]
if
cancelacion
is
None
:
account_invoice
.
write
(
{
'state'
:
account_invoice
.
cfdi_state
,
}
)
account_invoice
.
write
(
{
'state'
:
account_invoice
.
cfdi_state
}
)
elif
cancelacion
is
False
:
self
.
undo_waiting_state
()
else
:
...
...
@@ -306,16 +306,15 @@ class AccountInvoice(models.Model):
@
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
==
'
waiting
'
:
self
.
write
({
"
state
"
:
"
open
"
'
state
'
:
'
open
'
})
@
api
.
multi
def
action_consult_cancellation_status
(
self
):
""" """
for
account_invoice
in
self
:
res
=
None
status_cancelacion
=
account_invoice
.
consult_cfdi_cancellation_status
()
...
...
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