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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
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
Show 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):
...
@@ -2781,12 +2781,10 @@ class ListBoxValidator(Validator.Validator):
for
uid
in
listbox_uids
:
for
uid
in
listbox_uids
:
if
uid
[:
4
]
==
'new_'
:
if
uid
[:
4
]
==
'new_'
:
if
object_dict
is
None
:
if
object_dict
is
None
:
object_dict
=
{}
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
#LOG('ListBoxValidator', 0, 'call %s' % repr(list_method))
for
obj
in
list_method
(
REQUEST
=
REQUEST
,
**
params
):
object_list
=
list_method
(
REQUEST
=
REQUEST
,
**
params
)
object_dict
=
dict
()
for
obj
in
object_list
:
o_uid
=
obj
.
getUid
()
o_uid
=
obj
.
getUid
()
assert
o_uid
not
in
object_dict
,
\
assert
o_uid
not
in
object_dict
,
\
"List method returned duplicate uid %s %s"
%
(
"List method returned duplicate uid %s %s"
%
(
...
@@ -2822,20 +2820,17 @@ class ListBoxValidator(Validator.Validator):
...
@@ -2822,20 +2820,17 @@ class ListBoxValidator(Validator.Validator):
# Here we generate again the object_list with listbox the listbox we
# Here we generate again the object_list with listbox the listbox we
# have just created
# have just created
# XXX why ? -jerome
if
listbox
:
if
listbox
:
object_dict
=
{}
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
field
.
get_value
(
'list_method'
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
REQUEST
.
set
(
field
.
id
,
listbox
)
REQUEST
.
set
(
field
.
id
,
listbox
)
object_list
=
list_method
(
REQUEST
=
REQUEST
,
**
params
)
for
obj
in
list_method
(
REQUEST
=
REQUEST
,
**
params
):
object_dict
=
dict
()
for
obj
in
object_list
:
o_uid
=
obj
.
getUid
()
o_uid
=
obj
.
getUid
()
assert
o_uid
not
in
object_dict
,
\
assert
o_uid
not
in
object_dict
,
\
"List method returned duplicate uid %s"
%
o_uid
"List method returned duplicate uid %s"
%
o_uid
object_dict
[
o_uid
]
=
obj
object_dict
[
o_uid
]
=
obj
for
uid
in
listbox_uids
:
for
uid
in
listbox_uids
:
row_result
=
{}
row_result
=
{}
if
uid
[:
4
]
==
'new_'
:
if
uid
[:
4
]
==
'new_'
:
...
@@ -2878,19 +2873,20 @@ class ListBoxValidator(Validator.Validator):
...
@@ -2878,19 +2873,20 @@ class ListBoxValidator(Validator.Validator):
except
(
KeyError
,
NotFound
,
ValueError
),
err
:
except
(
KeyError
,
NotFound
,
ValueError
),
err
:
# It is possible that this object is not catalogged yet. So
# It is possible that this object is not catalogged yet. So
# the object must be obtained from ZODB.
# 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
=
field
.
get_value
(
'list_method'
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
list_method
=
getattr
(
here
,
list_method
.
method_name
)
object_list
=
list_method
(
REQUEST
=
REQUEST
,
**
params
)
for
obj
in
list_method
(
REQUEST
=
REQUEST
,
**
params
):
for
o
in
object_list
:
o_uid
=
str
(
obj
.
getUid
())
try
:
assert
o_uid
not
in
object_dict
,
\
if
o
.
getUid
()
==
int
(
uid
):
"List method returned duplicate uid %s"
%
o_uid
break
object_dict
[
o_uid
]
=
obj
except
ValueError
:
if
str
(
o
.
getUid
())
==
uid
:
o
=
object_dict
.
get
(
str
(
uid
))
break
if
o
is
None
:
else
:
raise
err
raise
err
row_key
=
o
.
getUrl
()
row_key
=
o
.
getUrl
()
for
sql
in
editable_column_ids
:
for
sql
in
editable_column_ids
:
editable_field
=
editable_field_dict
.
get
(
sql
.
replace
(
'.'
,
'_'
))
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