Commit 5870d719 by Juan

Update

1 parent 80534043
......@@ -5,4 +5,5 @@ from . import tipo_transporte
from . import punto_retiro
from . import dias
from . import solicitudes
from . import mensajes
\ No newline at end of file
from . import mensajes
from . import no_transporta
\ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import models, fields, api, exceptions
class trans_tipo_transporte(models.Model):
_name = 'trans.no_transporta'
_description = 'No se transporta'
_order = 'name desc'
name = fields.Char(
string=u'Tipo de transporte',
required=True,
)
\ No newline at end of file
......@@ -143,25 +143,32 @@ class trans_transportista(models.Model):
cliente_nombre = fields.Char(string='Razon social a facturar')
#trans_no_transporta = fields.Many2one(comodel_name='trans.no_transporta',
#string='Elementos que no transporta')
trans_no_trasnporta = fields.Many2many(
comodel_name='trans.no_transporta',
string='Elementos que no transporta')
def _compute_prev(self):
#print(dir(self.trans_logo), self.trans_logo, dir(self.imagen))
imagen = "http://hgtarg.com/logo.jpg"
if (self.trans_categoria == "p") and (not (self.url_img_publica == False or self.url_img_publica == "")):
imagen = self. url_img_publica
self.muestra = vista_previa.format(self.url_img,imagen)
for rec in self:
imagen = "http://hgtarg.com/logo.jpg"
if (rec.trans_categoria == "p") and (not (rec.url_img_publica == False or self.url_img_publica == "")):
imagen = rec. url_img_publica
rec.muestra = vista_previa.format(rec.url_img,imagen)
#@api.depends('ejecutor')
def _soy_administrador(self):
if self.env.user.has_group("hgt_transportar.module_group_administrador"):
self.soy_admin = "Soy adinistrador"
else:
self.soy_admin = ""
for rec in self:
if rec.env.user.has_group("hgt_transportar.module_group_administrador"):
rec.soy_admin = "Soy adinistrador"
else:
rec.soy_admin = ""
@api.one
@api.constrains('trans_cuit', 'trans_telefono')
......@@ -325,9 +332,12 @@ class trans_transportista(models.Model):
def comprar(self):
self.ActualizarCliente()
subs = self.env["elc.cobrosubs"].sudo().search([["id_master","=",self.id],["estado","in",["t","a","p"]]],order="id desc",limit=1)
#print(self)
#subs = self.env["elc.cobrosubs"].sudo().search([["id_master","=",self.id],["estado","in",["t","a","p"]]],order="id desc",limit=1)
subs = []
if len(subs) == 0:
msubs = self.env['elc.subcripciones'].sudo().browse(1)
msubs = self.env['elc.subcripciones'].sudo().browse(1)#Esto hay q ponerlo dinamico no se como aun
#print(msubs)
rta = msubs.CrearSubscripcionSDK(self.cliente_fac.id,self.id)
return(rta)
else:
......
......@@ -8,4 +8,5 @@ administrador_trans_tipo_transporte,access_administrador_trans_tipo_transporte,m
administrador_trans_punto_retiro,access_administrador_trans_punto_retiro,model_trans_punto_retiro,module_group_administrador,1,1,1,1
administrador_trans_dias,access_administrador_trans_dias,model_trans_dias,module_group_administrador,1,1,1,1
access_lappa_solicitudes,access_lappa_solicitudes,model_lappa_solicitudes,module_group_administrador,1,1,1,0
access_trans_mensajes,access_trans_mensajes,model_trans_mensajes,module_group_administrador,1,1,1,0
\ No newline at end of file
access_trans_mensajes,access_trans_mensajes,model_trans_mensajes,module_group_administrador,1,1,1,0
access_trans_no_transporta,access_trans_no_transporta,model_trans_no_transporta,module_group_transportista,1,1,1,0
\ No newline at end of file
......@@ -33,6 +33,7 @@
<field name="trans_nombre" colspan="2"/>
<field name="trans_razon_social" colspan="2" required="1"/>
<field name="trans_cuit" colspan="2" required="1"/>
<field name="trans_no_trasnporta" widget="many2many_tags"/>
</group>
<group col="2" string="Imagen">
<field name="trans_logo_nombre" invisible="1"/>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!