From fa34abb8b32f005174b178d6b7d85bf8d11bbfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 26 Sep 2021 23:05:02 +0200 Subject: [PATCH] Add grouping attribute to numeric widgets issue10731 review355501002 --- CHANGELOG | 1 + doc/topics/views/index.rst | 6 ++++++ trytond/ir/ui/form.rnc | 1 + trytond/ir/ui/form.rng | 11 +++++++++++ trytond/ir/ui/tree.rnc | 1 + trytond/ir/ui/tree.rng | 11 +++++++++++ 6 files changed, 31 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c56e892bd6..a10256266a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add grouping attribute to numeric widgets * Ensure with a test that objects in the Pool have __slots__ * Use bigdecimal tag for XML-RPC * Use tuple in Dict value instead of list diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index ce6de0acc3..08565e0a3a 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -167,6 +167,12 @@ List of attributes shared by many form elements: * ``symbol``: Only on numerical fields, the name of field which provides the symbol to display. + .. _common-attributes-grouping: + + * ``grouping``: A boolean only on numerical fields to specify if the client + must use grouping separators to display on the widget. The default value + is True. + .. _common-attributes-help_field: * ``help_field``: The name of Dict field mapping the Selection value with diff --git a/trytond/ir/ui/form.rnc b/trytond/ir/ui/form.rnc index 7fa3f46a81..ebab9de218 100644 --- a/trytond/ir/ui/form.rnc +++ b/trytond/ir/ui/form.rnc @@ -110,6 +110,7 @@ attlist.field &= attribute help_field { text }? attlist.field &= [a:defaultValue = "0"] attribute toolbar { "0" | "1" }? attlist.field &= attribute symbol { text }? +attlist.field &= [a:defaultValue = "1"] attribute grouping { "0" | "1" }? image = element image { attlist.image, empty } attlist.image &= attribute name { text } attlist.image &= [a:defaultValue = "icon"] attribute type { "icon" | "url" }? diff --git a/trytond/ir/ui/form.rng b/trytond/ir/ui/form.rng index 71d9ca490e..2047923bad 100644 --- a/trytond/ir/ui/form.rng +++ b/trytond/ir/ui/form.rng @@ -493,6 +493,17 @@ + + + + grouping + + 0 + 1 + + + + image diff --git a/trytond/ir/ui/tree.rnc b/trytond/ir/ui/tree.rnc index e17e03a9f2..f4199cc61d 100644 --- a/trytond/ir/ui/tree.rnc +++ b/trytond/ir/ui/tree.rnc @@ -66,6 +66,7 @@ attlist.field &= attribute filename { text }? attlist.field &= attribute help_field { text }? attlist.field &= attribute view_ids { text }? attlist.field &= attribute symbol { text }? +attlist.field &= [a:defaultValue = "1"] attribute grouping { "0" | "1" }? prefix = element prefix { attlist.affix, empty } suffix = element suffix { attlist.affix, empty } attlist.affix &= attribute string { text }? diff --git a/trytond/ir/ui/tree.rng b/trytond/ir/ui/tree.rng index cfcab2d026..c53029102c 100644 --- a/trytond/ir/ui/tree.rng +++ b/trytond/ir/ui/tree.rng @@ -272,6 +272,17 @@ + + + + grouping + + 0 + 1 + + + + prefix