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 749b5688
authored
2021-04-30 10:18:50 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Impresion directa
1 parent
450bb317
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
models/comprobante.py
views/comprobante.xml
models/comprobante.py
View file @
749b568
# -*- coding: utf-8 -*-
from
odoo
import
models
,
fields
,
api
,
exceptions
from
.qr
import
qrfiscal
from
odoo.exceptions
import
UserError
,
ValidationError
,
Warning
,
RedirectWarning
import
base64
class
asw_comprobante
(
models
.
Model
):
_inherit
=
'asw.comprobante'
...
...
@@ -102,4 +104,18 @@ class asw_comprobante(models.Model):
def
recalcularTotal
(
self
):
self
.
_onchange_comp_linea_facturas
()
def
impresion_directa
(
self
):
result
=
self
.
imprimir
()
report_action
=
self
.
env
[
result
[
'type'
]]
.
_get_report_from_name
(
result
[
'report_name'
])
pdf
=
report_action
.
render_aeroo
([
self
.
id
],
{
'context'
:
self
.
env
.
context
})
try
:
#pdf = self.env.ref('hgt_produccion.remito_qweb').render_qweb_pdf(self.ids)
val
=
{}
val
[
"tipo"
]
=
'impresora'
val
[
"bs64"
]
=
base64
.
encodestring
(
pdf
[
0
])
self
.
env
[
"hw.puesto_trabajo"
]
.
UsarDispositivo
(
val
)
#print(base64.encodestring(pdf[0]))
except
:
raise
Warning
(
"No tiene instalado este modulo en su sistema contactese con HGT"
)
views/comprobante.xml
View file @
749b568
...
...
@@ -30,6 +30,7 @@
<xpath
expr=
"//button[@name='validar']"
position=
"after"
>
<button
name=
"abrir_wizard_ppf"
class=
'btn btn-success'
string=
"+ Producto por precio final"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
<button
name=
"recalcularTotal"
class=
'btn btn-warning'
string=
"Recalcular Monto"
type=
"object"
attrs=
"{'invisible':[('comp_estado','!=','b')]}"
/>
<button
name=
"impresion_directa"
class=
'btn btn-info'
string=
"Impresion directa"
type=
"object"
attrs=
"{'invisible':[('comp_estado','=','b')]}"
/>
</xpath>
</data>
</field>
...
...
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