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
570c8701
Commit
570c8701
authored
6 years ago
by
Cuauhtémoc Díaz Minor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(account.invoice): se agrega el estado waiting
se extiende el campo state y se agrega ('waiting', 'To cancel')
parent
5d563d7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
l10n_mx_facturae/models/account_invoice.py
l10n_mx_facturae/models/account_invoice.py
+8
-6
No files found.
l10n_mx_facturae/models/account_invoice.py
View file @
570c8701
...
...
@@ -195,6 +195,8 @@ class AccountInvoice(models.Model):
'cfdi.relation.type'
,
'CFDI Relation type'
,
)
state
=
fields
.
Selection
(
selection_add
=
[(
'waiting'
,
_
(
'To cancel'
))])
@
api
.
one
@
api
.
depends
(
'state'
)
def
_compute_datetime
(
self
):
...
...
@@ -214,7 +216,7 @@ class AccountInvoice(models.Model):
date_invoice
=
False
,
payment_term
=
False
,
partner_bank_id
=
False
,
company_id
=
False
,
context
=
None
,
):
# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments
, redefined-builtin
"""Copy fields cfdi_use, payment_method_id and cfdi_adenda_id
from selected partner
"""
...
...
@@ -278,13 +280,13 @@ class AccountInvoice(models.Model):
account_invoice
.
cfdi_folio_fiscal
):
cancelacion
=
account_invoice
.
cancel_cfdi
()[
0
]
account_invoice
.
write
({
'state'
:
account_invoice
.
cfdi_state
,
})
if
cancelacion
:
super
(
AccountInvoice
,
self
).
action_cancel
()
res
=
super
(
AccountInvoice
,
self
).
action_cancel
()
account_invoice
.
unlink_cfdi
()
return
account_invoice
.
write
({
'state'
:
account_invoice
.
cfdi_state
,
})
return
res
@
staticmethod
def
_sanitize
(
text
):
...
...
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