Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ludovic Kiefer
erp5
Commits
77a53809
Commit
77a53809
authored
May 28, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix undefined variables
parent
84029c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
product/ERP5Form/ListBox.py
product/ERP5Form/ListBox.py
+16
-20
No files found.
product/ERP5Form/ListBox.py
View file @
77a53809
...
...
@@ -2781,12 +2781,10 @@ class ListBoxValidator(Validator.Validator):
for
uid
in
listbox_uids
:
if
uid
[:
4
]
==
'new_'
:
if
object_dict
is
None
:
object_dict
=
{}
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
#LOG('ListBoxValidator', 0, 'call %s' % repr(list_method))
object_list
=
list_method
(
REQUEST
=
REQUEST
,
**
params
)
object_dict
=
dict
()
for
obj
in
object_list
:
for
obj
in
list_method
(
REQUEST
=
REQUEST
,
**
params
):
o_uid
=
obj
.
getUid
()
assert
o_uid
not
in
object_dict
,
\
"List method returned duplicate uid %s %s"
%
(
...
...
@@ -2822,20 +2820,17 @@ class ListBoxValidator(Validator.Validator):
# Here we generate again the object_list with listbox the listbox we
# have just created
# XXX why ? -jerome
if
listbox
:
object_dict
=
{}
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
REQUEST
.
set
(
field
.
id
,
listbox
)
object_list
=
list_method
(
REQUEST
=
REQUEST
,
**
params
)
object_dict
=
dict
()
for
obj
in
object_list
:
for
obj
in
list_method
(
REQUEST
=
REQUEST
,
**
params
):
o_uid
=
obj
.
getUid
()
assert
o_uid
not
in
object_dict
,
\
"List method returned duplicate uid %s"
%
o_uid
object_dict
[
o_uid
]
=
obj
for
uid
in
listbox_uids
:
row_result
=
{}
if
uid
[:
4
]
==
'new_'
:
...
...
@@ -2878,19 +2873,20 @@ class ListBoxValidator(Validator.Validator):
except
(
KeyError
,
NotFound
,
ValueError
),
err
:
# It is possible that this object is not catalogged yet. So
# the object must be obtained from ZODB.
if
object_list
is
None
:
if
object_dict
is
None
:
object_dict
=
{}
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
object_list
=
list_method
(
REQUEST
=
REQUEST
,
**
params
)
for
o
in
object_list
:
try
:
if
o
.
getUid
()
==
int
(
uid
):
break
except
ValueError
:
if
str
(
o
.
getUid
())
==
uid
:
break
else
:
raise
err
for
obj
in
list_method
(
REQUEST
=
REQUEST
,
**
params
):
o_uid
=
str
(
obj
.
getUid
())
assert
o_uid
not
in
object_dict
,
\
"List method returned duplicate uid %s"
%
o_uid
object_dict
[
o_uid
]
=
obj
o
=
object_dict
.
get
(
str
(
uid
))
if
o
is
None
:
raise
err
row_key
=
o
.
getUrl
()
for
sql
in
editable_column_ids
:
editable_field
=
editable_field_dict
.
get
(
sql
.
replace
(
'.'
,
'_'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment