Commit 80534043 by Juan

Confirmacion d pago

1 parent 543a25f6
...@@ -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
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!