Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
What's new
2
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniel Santibáñez Polanco
l10n_cl_fe
Commits
1d516347
Commit
1d516347
authored
Jul 02, 2018
by
Daniel Santibáñez Polanco
Browse files
Modular para hacer inherit en otros módulos
parent
48f80e1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
__manifest__.py
View file @
1d516347
...
...
@@ -2,7 +2,7 @@
{
"name"
:
"""Facturación Electrónica para Chile
\
"""
,
'version'
:
'0.4.
3
'
,
'version'
:
'0.4.
4
'
,
'category'
:
'Localization/Chile'
,
'sequence'
:
12
,
'author'
:
'Daniel Santibáñez Polanco, Cooperativa OdooCoop'
,
...
...
controllers/boleta.py
View file @
1d516347
...
...
@@ -31,7 +31,6 @@ class Boleta(http.Controller):
orders
=
Model
.
search
(
domain
,
limit
=
1
)
return
orders
@
http
.
route
([
'/boleta/<int:folio>'
],
type
=
'http'
,
auth
=
"public"
,
website
=
True
)
def
view_document
(
self
,
folio
=
None
,
**
post
):
if
'otra_boleta'
in
post
:
...
...
@@ -44,14 +43,14 @@ class Boleta(http.Controller):
}
return
request
.
render
(
'l10n_cl_fe.boleta_layout'
,
values
)
def
_get_report
(
self
,
document
):
return
request
.
env
.
ref
(
'account.account_invoices'
).
sudo
().
render_qweb_pdf
([
document
.
id
])[
0
]
@
http
.
route
([
'/download/boleta'
],
type
=
'http'
,
auth
=
"public"
,
website
=
True
)
def
download_boleta
(
self
,
**
post
):
document
=
request
.
env
[
post
[
'model'
]].
sudo
().
browse
(
int
(
post
[
'model_id'
]))
file_name
=
document
.
_get_printed_report_name
()
if
document
.
_name
==
'account.invoice'
:
pdf
=
request
.
env
.
ref
(
'account.account_invoices'
).
sudo
().
render_qweb_pdf
([
document
.
id
])[
0
]
else
:
pdf
=
request
.
env
.
ref
(
'l10n_cl_fe.action_report_pos_boleta_ticket'
).
sudo
().
render_qweb_pdf
([
document
.
id
])[
0
]
pdf
=
self
.
_get_report
(
document
)
pdfhttpheaders
=
[
(
'Content-Type'
,
'application/pdf'
),
(
'Content-Length'
,
len
(
pdf
)),
(
'Content-Disposition'
,
'attachment; filename=%s.pdf;'
%
file_name
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment