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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 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
)
msubs
=
self
.
env
[
'elc.subcripciones'
]
.
sudo
()
.
browse
(
1
)
if
len
(
subs
)
==
0
:
rta
=
msubs
.
CrearSubscripcionSDK
(
self
.
cliente_fac
.
id
)
msubs
=
self
.
env
[
'elc.subcripciones'
]
.
sudo
()
.
browse
(
1
)
return
(
rta
)
rta
=
msubs
.
CrearSubscripcionSDK
(
self
.
cliente_fac
.
id
,
self
.
id
)
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
):
...
@@ -379,4 +384,7 @@ class trans_transportista(models.Model):
...
@@ -379,4 +384,7 @@ class trans_transportista(models.Model):
return
(
self
.
url_img_publica
)
return
(
self
.
url_img_publica
)
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