File tree 5 files changed +31
-0
lines changed
5 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Changelog
4
4
1.2.0 (unreleased)
5
5
------------------
6
6
7
+ - #42 Fix cannot enter small decimals in breakpoint table
7
8
- #40 Compatibility with core#2537 (Support multi-text on result entry)
8
9
- #39 Compatibility with core#2584 (SampleType to DX)
9
10
- #38 Compatibility with core#2595 (Move ARAnalysesField logic to data manager)
Original file line number Diff line number Diff line change 20
20
<include package =" .adapters" />
21
21
<include package =" .behaviors" />
22
22
<include package =" .browser" />
23
+ <include package =" .patches" />
23
24
<include package =" .subscribers" />
24
25
<include package =" .upgrade" />
25
26
<include package =" .workflow" />
Original file line number Diff line number Diff line change
1
+ <configure
2
+ xmlns =" http://namespaces.zope.org/zope"
3
+ xmlns : monkey =" http://namespaces.plone.org/monkey"
4
+ i18n_domain =" senaite.ast" >
5
+
6
+ <monkey : patch
7
+ description =" Patch `z3c.form.converter.NumberDataConverter` to prevent
8
+ the error 'The entered value is not a valid decimal literal`
9
+ for small declimal values like '0.0625'"
10
+ class =" z3c.form.converter.NumberDataConverter"
11
+ original =" toFieldValue"
12
+ replacement =" .converter.toFieldValue" />
13
+
14
+ </configure >
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import zope .i18n .format
4
+ from z3c .form .converter import FormatterValidationError
5
+
6
+ DECIMAL_PATTERN = u'#,##0.######;-#,##0.######'
7
+
8
+ def toFieldValue (self , value ):
9
+ """See interfaces.IDataConverter"""
10
+ if value == u'' :
11
+ return self .field .missing_value
12
+ try :
13
+ return self .formatter .parse (value , pattern = DECIMAL_PATTERN )
14
+ except zope .i18n .format .NumberParseError :
15
+ raise FormatterValidationError (self .errorMessage , value )
You can’t perform that action at this time.
0 commit comments