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 5870d719
authored
2022-02-07 14:48:05 -0300
by
Juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update
1 parent
80534043
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
8 deletions
.gitignore
models/__init__.py
models/no_transporta.py
models/transportista.py
security/ir.model.access.csv
views/transportista_vista.xml
.gitignore
0 → 100644
View file @
5870d71
*.pyc
models/__init__.py
View file @
5870d71
...
@@ -6,3 +6,4 @@ from . import punto_retiro
...
@@ -6,3 +6,4 @@ from . import punto_retiro
from
.
import
dias
from
.
import
dias
from
.
import
solicitudes
from
.
import
solicitudes
from
.
import
mensajes
from
.
import
mensajes
from
.
import
no_transporta
\ No newline at end of file
\ No newline at end of file
models/no_transporta.py
0 → 100644
View file @
5870d71
# -*- 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
\ No newline at end of file
models/transportista.py
View file @
5870d71
...
@@ -143,7 +143,12 @@ class trans_transportista(models.Model):
...
@@ -143,7 +143,12 @@ class trans_transportista(models.Model):
cliente_nombre
=
fields
.
Char
(
string
=
'Razon social a facturar'
)
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'
)
...
@@ -151,17 +156,19 @@ class trans_transportista(models.Model):
...
@@ -151,17 +156,19 @@ class trans_transportista(models.Model):
def
_compute_prev
(
self
):
def
_compute_prev
(
self
):
#print(dir(self.trans_logo), self.trans_logo, dir(self.imagen))
#print(dir(self.trans_logo), self.trans_logo, dir(self.imagen))
for
rec
in
self
:
imagen
=
"http://hgtarg.com/logo.jpg"
imagen
=
"http://hgtarg.com/logo.jpg"
if
(
self
.
trans_categoria
==
"p"
)
and
(
not
(
self
.
url_img_publica
==
False
or
self
.
url_img_publica
==
""
)):
if
(
rec
.
trans_categoria
==
"p"
)
and
(
not
(
rec
.
url_img_publica
==
False
or
self
.
url_img_publica
==
""
)):
imagen
=
self
.
url_img_publica
imagen
=
rec
.
url_img_publica
self
.
muestra
=
vista_previa
.
format
(
self
.
url_img
,
imagen
)
rec
.
muestra
=
vista_previa
.
format
(
rec
.
url_img
,
imagen
)
#@api.depends('ejecutor')
#@api.depends('ejecutor')
def
_soy_administrador
(
self
):
def
_soy_administrador
(
self
):
if
self
.
env
.
user
.
has_group
(
"hgt_transportar.module_group_administrador"
):
for
rec
in
self
:
self
.
soy_admin
=
"Soy adinistrador"
if
rec
.
env
.
user
.
has_group
(
"hgt_transportar.module_group_administrador"
):
rec
.
soy_admin
=
"Soy adinistrador"
else
:
else
:
self
.
soy_admin
=
""
rec
.
soy_admin
=
""
@api.one
@api.one
@api.constrains
(
'trans_cuit'
,
'trans_telefono'
)
@api.constrains
(
'trans_cuit'
,
'trans_telefono'
)
...
@@ -325,9 +332,12 @@ class trans_transportista(models.Model):
...
@@ -325,9 +332,12 @@ class trans_transportista(models.Model):
def
comprar
(
self
):
def
comprar
(
self
):
self
.
ActualizarCliente
()
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
:
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
)
rta
=
msubs
.
CrearSubscripcionSDK
(
self
.
cliente_fac
.
id
,
self
.
id
)
return
(
rta
)
return
(
rta
)
else
:
else
:
...
...
security/ir.model.access.csv
View file @
5870d71
...
@@ -9,3 +9,4 @@ administrador_trans_punto_retiro,access_administrador_trans_punto_retiro,model_t
...
@@ -9,3 +9,4 @@ administrador_trans_punto_retiro,access_administrador_trans_punto_retiro,model_t
administrador_trans_dias,access_administrador_trans_dias,model_trans_dias,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_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
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
\ No newline at end of file
views/transportista_vista.xml
View file @
5870d71
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
<field
name=
"trans_nombre"
colspan=
"2"
/>
<field
name=
"trans_nombre"
colspan=
"2"
/>
<field
name=
"trans_razon_social"
colspan=
"2"
required=
"1"
/>
<field
name=
"trans_razon_social"
colspan=
"2"
required=
"1"
/>
<field
name=
"trans_cuit"
colspan=
"2"
required=
"1"
/>
<field
name=
"trans_cuit"
colspan=
"2"
required=
"1"
/>
<field
name=
"trans_no_trasnporta"
widget=
"many2many_tags"
/>
</group>
</group>
<group
col=
"2"
string=
"Imagen"
>
<group
col=
"2"
string=
"Imagen"
>
<field
name=
"trans_logo_nombre"
invisible=
"1"
/>
<field
name=
"trans_logo_nombre"
invisible=
"1"
/>
...
...
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