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 1bfbade0
authored
2022-11-14 11:15:55 -0300
by
adrian
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Cambio en controlador que no debio ser necesario
1 parent
18e246ac
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
controllers/controllers.py
index.html
controllers/controllers.py
View file @
1bfbade
...
...
@@ -46,6 +46,7 @@ class dispositivos(http.Controller):
except
:
pagina
=
1
resultado
=
self
.
ArmarListaTrans
(
kw
[
"loc1"
],
kw
[
"loc2"
])
##print(resultado)
transportista
=
self
.
paginadoTransportistas
(
resultado
[
0
],
pagina
)
return
(
json
.
dumps
({
"origen"
:
resultado
[
1
],
"destino"
:
resultado
[
2
],
...
...
@@ -80,10 +81,11 @@ class dispositivos(http.Controller):
def
ArmarListaTrans
(
self
,
loc1
,
loc2
):
loc1
=
self
.
TransportistaLocalidad
(
loc1
)
loc2
=
self
.
TransportistaLocalidad
(
loc2
)
#print(loc1,loc2)
origen
=
loc1
[
1
]
destino
=
loc2
[
1
]
if
(
len
(
loc1
)
==
0
)
or
(
len
(
loc2
)
==
0
)
:
print
(
"cero"
)
#
print("cero")
return
([],
origen
,
destino
)
trans_ids
=
list
(
set
(
loc1
[
0
])
&
set
(
loc2
[
0
]))
transportistas
=
http
.
request
.
env
[
'trans.transportista'
]
.
sudo
()
.
browse
(
trans_ids
)
...
...
@@ -111,8 +113,11 @@ class dispositivos(http.Controller):
return
(
dato
)
def
TransportistaLocalidad
(
self
,
loc_id
):
#corregida la funcion esta lambda ponia lento todo
p
untos
=
http
.
request
.
env
[
'trans.punto_retiro'
]
.
sudo
()
.
search
([[
"pr_localidad"
,
"="
,
loc_id
]]
)
p
rint
(
loc_id
)
local
=
http
.
request
.
env
[
'asw.localidad'
]
.
sudo
()
.
search
([[
"id"
,
"="
,
loc_id
]])
puntos
=
http
.
request
.
env
[
'trans.punto_retiro'
]
.
sudo
()
.
search
([[
"pr_localidad"
,
"="
,
local
.
id
]])
#print(puntos)
#print(local)
#puntos = puntos.filtered(lambda l: l.pr_localidad == local)
resultado
=
[]
for
punto
in
puntos
:
...
...
index.html
0 → 100644
View file @
1bfbade
This diff is collapsed.
Click to expand it.
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