From 3549a83bfc30f8eee5b25f9f121537be50ccc7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 26 Jun 2013 22:59:28 +0200 Subject: [PATCH] Add factor on number fields review824002 --- CHANGELOG | 1 + doc/topics/views/index.rst | 12 ++++++++++++ trytond/ir/ui/form.rnc | 1 + trytond/ir/ui/form.rng | 5 +++++ trytond/ir/ui/tree.rnc | 1 + trytond/ir/ui/tree.rng | 5 +++++ 6 files changed, 25 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5a0e011e39..018a0ba656 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add factor on number fields * Add calendar view * Remove request diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index 424c5328f0..7e2f73f9a5 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -133,6 +133,14 @@ List of attributes shared by many form elements: :class:`trytond.model.fields.One2Many` to specifiy if the client must auto-complete the field. The default value is True. + .. _common-attributes-factor: + + * ``factor``: A factor to apply on fields + :class:`trytond.model.fields.Integer`, + :class:`trytond.model.fields.Float` and + :class:`trytond.model.fields.Numeric` to display on the widget. The + default value is 1. + form ^^^^ @@ -235,6 +243,8 @@ Display a field of the object with the value of the current record. * ``completion``: see in common-attributes-completion_. + * ``factor``: see in common-attributes-factor_. + image ^^^^^ @@ -491,6 +501,8 @@ field * ``completion``: see in common-attributes-completion_. + * ``factor``: see in common-attributes-factor_. + prefix or suffix ^^^^^^^^^^^^^^^^ diff --git a/trytond/ir/ui/form.rnc b/trytond/ir/ui/form.rnc index b7cd2ce0f0..81b64fd8f4 100644 --- a/trytond/ir/ui/form.rnc +++ b/trytond/ir/ui/form.rnc @@ -104,6 +104,7 @@ attlist.field &= [a:defaultValue = "0"] attribute pre_validate { "0" | "1" }? attlist.field &= attribute icon { text }? attlist.field &= [a:defaultValue = "1"] attribute completion { "0" | "1" }? attlist.field &= attribute string { text }? +attlist.field &= [a:defaultValue = "1"] attribute factor { text }? image = element image { attlist.image, empty } attlist.image &= attribute name { text } attlist.image &= [ a:defaultValue = "1" ] attribute colspan { text }? diff --git a/trytond/ir/ui/form.rng b/trytond/ir/ui/form.rng index 35bfe4ed05..dd0a3186d1 100644 --- a/trytond/ir/ui/form.rng +++ b/trytond/ir/ui/form.rng @@ -379,6 +379,11 @@ + + + + + diff --git a/trytond/ir/ui/tree.rnc b/trytond/ir/ui/tree.rnc index e66066dc6c..e422d93099 100644 --- a/trytond/ir/ui/tree.rnc +++ b/trytond/ir/ui/tree.rnc @@ -52,6 +52,7 @@ attlist.field &= attlist.field &= attribute float_time { text }? attlist.field &= [a:defaultValue = "0"] attribute pre_validate { "0" | "1" }? attlist.field &= [a:defaultValue = "1"] attribute completion { "0" | "1" }? +attlist.field &= [a:defaultValue = "1"] attribute factor { text }? 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 5d5b1da9fa..12e9ef3d82 100644 --- a/trytond/ir/ui/tree.rng +++ b/trytond/ir/ui/tree.rng @@ -172,6 +172,11 @@ + + + + +