Reviewers: ,
Please review this at http://codereview.tryton.org/581002/
Affected files:
CHANGELOG
doc/topics/views/index.rst
trytond/ir/ui/form.rnc
trytond/ir/ui/form.rng
trytond/ir/ui/tree.rnc
trytond/ir/ui/tree.rng
Index: CHANGELOG
===================================================================
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+* Add completion attribute for Many2One, Many2Many and One2Many
+
Version 2.6.0 - 2012-10-22
* Bug fixes (see mercurial logs for details)
* Add pre-validation
Index: doc/topics/views/index.rst
===================================================================
--- a/doc/topics/views/index.rst
+++ b/doc/topics/views/index.rst
@@ -125,6 +125,14 @@
pre-validate the records using
:meth:`trytond.model.Model.pre_validate`.
+ .. _common-attributes-completion:
+
+ * ``completion``: A boolean only for fields
+ :class:`trytond.model.fields.Many2One`,
+ :class:`trytond.model.fields.Many2Many` and
+ :class:`trytond.model.fields.One2Many` to specifiy if the client must
+ auto-complete the field. The default value is True.
+
form
^^^^
@@ -225,6 +233,8 @@
* ``pre_validate``: see in common-attributes-pre_validate_.
+ * ``completion``: see in common-attributes-completion_.
+
image
^^^^^
@@ -482,6 +492,8 @@
* ``pre_validate``: see in common-attributes-pre_validate_.
+ * ``completion``: see in common-attributes-completion_.
+
Example
-------
Index: trytond/ir/ui/form.rnc
===================================================================
--- a/trytond/ir/ui/form.rnc
+++ b/trytond/ir/ui/form.rnc
@@ -102,6 +102,7 @@
attlist.field &=
[a:defaultValue = "0"] attribute filename_visible { "0" | "1" }?
attlist.field &= [a:defaultValue = "0"] attribute pre_validate { "0" | "1"
}?
+attlist.field &= [a:defaultValue = "1"] attribute completion { "0" | "1" }?
image = element image { attlist.image, empty }
attlist.image &= attribute name { text }
attlist.image &= [ a:defaultValue = "1" ] attribute colspan { text }?
Index: trytond/ir/ui/form.rng
===================================================================
--- a/trytond/ir/ui/form.rng
+++ b/trytond/ir/ui/form.rng
@@ -364,6 +364,16 @@
</attribute>
</optional>
</define>
+ <define name="attlist.field" combine="interleave">
+ <optional>
+ <attribute name="completion" a:defaultValue="1">
+ <choice>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
<define name="image">
<element name="image">
<ref name="attlist.image"/>
Index: trytond/ir/ui/tree.rnc
===================================================================
--- a/trytond/ir/ui/tree.rnc
+++ b/trytond/ir/ui/tree.rnc
@@ -51,6 +51,7 @@
}?
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" }?
button = element button { attlist.button, empty }
attlist.button &= attribute help { text }?
attlist.button &=
Index: trytond/ir/ui/tree.rng
===================================================================
--- a/trytond/ir/ui/tree.rng
+++ b/trytond/ir/ui/tree.rng
@@ -157,6 +157,16 @@
</attribute>
</optional>
</define>
+ <define name="attlist.field" combine="interleave">
+ <optional>
+ <attribute name="completion" a:defaultValue="1">
+ <choice>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
<define name="button">
<element name="button">
<ref name="attlist.button"/>
--
[email protected] mailing list