Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Maria Agustina
/
hgt_transportar
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 80534043
authored
2021-11-07 20:58:25 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Confirmacion d pago
1 parent
543a25f6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
models/transportista.py
models/transportista.py
View file @
8053404
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
odoo
import
models
,
fields
,
api
,
exceptions
from
odoo
import
models
,
fields
,
api
,
exceptions
from
odoo.exceptions
import
ValidationError
,
Warning
from
odoo.exceptions
import
ValidationError
,
Warning
from
datetime
import
datetime
from
datetime
import
datetime
import
base64
,
requests
import
base64
,
requests
,
json
vista_previa
=
"""<h2>Vista Previa</h2>
vista_previa
=
"""<h2>Vista Previa</h2>
<img src="{}" alt="Previsualizacion" style="max-height: 400px; max-width: 400px;"/>
<img src="{}" alt="Previsualizacion" style="max-height: 400px; max-width: 400px;"/>
<h2>Publicado</h2>
<h2>Publicado</h2>
...
@@ -325,10 +325,15 @@ class trans_transportista(models.Model):
...
@@ -325,10 +325,15 @@ class trans_transportista(models.Model):
def
comprar
(
self
):
def
comprar
(
self
):
self
.
ActualizarCliente
()
self
.
ActualizarCliente
()
#Armar subscripcion
subs
=
self
.
env
[
"elc.cobrosubs"
]
.
sudo
()
.
search
([[
"id_master"
,
"="
,
self
.
id
],[
"estado"
,
"in"
,[
"t"
,
"a"
,
"p"
]]],
order
=
"id desc"
,
limit
=
1
)
if
len
(
subs
)
==
0
:
msubs
=
self
.
env
[
'elc.subcripciones'
]
.
sudo
()
.
browse
(
1
)
msubs
=
self
.
env
[
'elc.subcripciones'
]
.
sudo
()
.
browse
(
1
)
rta
=
msubs
.
CrearSubscripcionSDK
(
self
.
cliente_fac
.
id
)
rta
=
msubs
.
CrearSubscripcionSDK
(
self
.
cliente_fac
.
id
,
self
.
id
)
return
(
rta
)
return
(
rta
)
else
:
data
=
json
.
loads
(
subs
.
raw_entrante
)
url
=
data
[
"init_point"
]
return
({
"url"
:
url
,
"type"
:
"ir.actions.act_url"
})
def
ActualizarCliente
(
self
):
def
ActualizarCliente
(
self
):
...
@@ -380,3 +385,6 @@ class trans_transportista(models.Model):
...
@@ -380,3 +385,6 @@ class trans_transportista(models.Model):
else
:
else
:
return
(
"http://hgtarg.com/logo.jpg"
)
return
(
"http://hgtarg.com/logo.jpg"
)
def
Confirmacion
(
self
):
self
.
trans_categoria
=
"p"
\ No newline at end of file
\ No newline at end of file
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