Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tryton
Tryton
Commits
85442ca80e4b
Commit
85442ca8
authored
Jan 25, 2023
by
Cédric Krier
Browse files
Convert empty value as null instead of 0 in Dict numeric fields
Closes
#12038
parent
ecf3f470e900
Pipeline
#61738
passed with stages
in 6 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sao/src/view/form.js
View file @
85442ca8
...
...
@@ -5192,7 +5192,11 @@
}
},
get_value
:
function
()
{
var
value
=
Number
(
this
.
input
.
val
());
var
value
=
this
.
input
.
val
();
if
(
!
value
&&
(
value
!==
0
))
{
return
null
;
}
value
=
Number
(
value
);
if
(
isNaN
(
value
))
{
return
null
;
}
...
...
@@ -5215,7 +5219,11 @@
Sao
.
View
.
Form
.
Dict
.
Numeric
=
Sao
.
class_
(
Sao
.
View
.
Form
.
Dict
.
Float
,
{
class_
:
'
dict-numeric
'
,
get_value
:
function
()
{
var
value
=
new
Sao
.
Decimal
(
this
.
input
.
val
());
var
value
=
this
.
input
.
val
();
if
(
!
value
&&
(
value
!==
0
))
{
return
null
;
}
value
=
new
Sao
.
Decimal
(
value
);
if
(
isNaN
(
value
.
valueOf
()))
{
return
null
;
}
...
...
Write
Preview
Supports
Markdown
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