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
Binh
erp5
Commits
e1d57590
Commit
e1d57590
authored
May 11, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Form: fix action to proxify fields with DateTime property values
parent
11d76d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
product/ERP5Form/Form.py
product/ERP5Form/Form.py
+7
-10
No files found.
product/ERP5Form/Form.py
View file @
e1d57590
...
...
@@ -41,6 +41,7 @@ from Products.ERP5Type import PropertySheet, Permissions
from
urllib
import
quote
from
Products.ERP5Type.Globals
import
DTMLFile
,
get_request
from
AccessControl
import
Unauthorized
,
ClassSecurityInfo
from
DateTime
import
DateTime
from
ZODB.POSException
import
ConflictError
from
zExceptions
import
Redirect
from
Acquisition
import
aq_base
...
...
@@ -1058,21 +1059,17 @@ class ERP5Form(Base, ZMIForm, ZopePageTemplate):
are different. And if you specify keep_empty_value, then empty values
will not be delegated(force_delegate option is high priority).
"""
copy_type_list
=
(
bytes
,
unicode
,
int
,
long
,
float
,
bool
,
list
,
tuple
,
dict
,
DateTime
)
def
copy
(
field
,
value_type
):
new_dict
=
{}
for
key
,
value
in
getFieldDict
(
field
,
value_type
).
iteritems
():
if
(
keep_empty_value
is
False
and
(
value
==
''
or
value
==
0
or
(
isinstance
(
value
,
(
tuple
,
list
))
and
len
(
value
)
==
0
)
)
):
continue
if
isinstance
(
aq_base
(
value
),
(
Method
,
TALESMethod
)):
value
=
copyMethod
(
value
)
elif
value
is
not
None
and
not
isinstance
(
value
,
(
str
,
unicode
,
int
,
long
,
float
,
bool
,
list
,
tuple
,
dict
)):
raise
ValueError
,
'%s:%s'
%
(
type
(
value
),
repr
(
value
))
elif
not
(
value
is
None
or
isinstance
(
value
,
copy_type_list
)):
raise
ValueError
(
'%s:%r'
%
(
type
(
value
),
value
))
elif
not
(
keep_empty_value
or
value
):
continue
new_dict
[
key
]
=
value
return
new_dict
...
...
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