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
Tristan Cavelier
erp5
Commits
65480a09
Commit
65480a09
authored
May 20, 2019
by
Tristan Cavelier
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DATETIMEFIELDUPDATE fix for linesfield
parent
98101f69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
...plateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
+9
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
View file @
65480a09
...
...
@@ -92,6 +92,13 @@ and handling data send&receive.
}
}
function
ensureComparable
(
value
,
field_type
)
{
// For LinesField, getContent returns string, but we may give an array of strings to the render method.
if
(
field_type
===
"
LinesField
"
)
{
return
value
.
join
?
value
.
join
(
"
\n
"
)
:
value
;
}
if
(
typeof
value
===
"
object
"
)
{
return
JSON
.
stringify
(
value
);
}
return
value
;
}
function
updateErp5DocumentForAfterSave
(
new_erp5_document
,
submitted_content
,
current_content
)
{
var
view
=
new_erp5_document
.
_embedded
.
_view
,
content_key_list
=
Object
.
keys
(
current_content
),
...
...
@@ -107,7 +114,8 @@ and handling data send&receive.
for
(
i
=
0
;
i
<
content_key_list
.
length
;
i
+=
1
)
{
key
=
content_key_list
[
i
];
if
(
document_reference_dict
[
key
]
&&
JSON
.
stringify
(
submitted_content
[
key
])
===
JSON
.
stringify
(
document_reference_dict
[
key
].
default
))
{
ensureComparable
(
submitted_content
[
key
],
document_reference_dict
[
key
].
type
)
===
ensureComparable
(
document_reference_dict
[
key
].
default
,
document_reference_dict
[
key
].
type
))
{
document_reference_dict
[
key
].
default
=
current_content
[
key
];
}
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
View file @
65480a09
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.56533.481
2
7.29525
</string>
</value>
<value>
<string>
975.56533.481
3
7.29525
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
15584480
8
0.86
</float>
<float>
15584480
9
0.86
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Tristan Cavelier
@tc
mentioned in commit
de09c73f
·
Jun 17, 2019
mentioned in commit
de09c73f
mentioned in commit de09c73ff66448bac1f991d7f1307181d1b43c47
Toggle commit list
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