changeset 8baafacac571 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=8baafacac571
description:
Support create/delete attribute in view
issue10840
review377341002
diffstat:
CHANGELOG | 1 +
doc/topics/views/index.rst | 8 ++++++++
trytond/ir/ui/form.rnc | 4 ++++
trytond/ir/ui/form.rng | 22 ++++++++++++++++++++++
trytond/ir/ui/tree.rnc | 4 ++++
trytond/ir/ui/tree.rng | 22 ++++++++++++++++++++++
6 files changed, 61 insertions(+), 0 deletions(-)
diffs (118 lines):
diff -r 41bae0ca6718 -r 8baafacac571 CHANGELOG
--- a/CHANGELOG Mon Oct 11 15:14:57 2021 +0200
+++ b/CHANGELOG Mon Oct 11 22:53:02 2021 +0200
@@ -1,3 +1,4 @@
+* Support create/delete attribute in view
* Skip default values when copying records
* Use global cache for Function fields in readonly transactions
* Add format method to DictSchemaMixin
diff -r 41bae0ca6718 -r 8baafacac571 doc/topics/views/index.rst
--- a/doc/topics/views/index.rst Mon Oct 11 15:14:57 2021 +0200
+++ b/doc/topics/views/index.rst Mon Oct 11 22:53:02 2021 +0200
@@ -154,6 +154,14 @@
:class:`trytond.model.fields.One2Many` to specifiy if the client must
auto-complete the field. The default value is True.
+ .. _common-attributes-create:
+
+ * ``create``: A boolean to specify if the user can create targets from the
+ widget. The default value is ``True``.
+
+ * ``delete``: A boolean to specify if the user can delete targets from the
+ widget. The default value is ``True``.
+
.. _common-attributes-factor:
* ``factor``: A factor to apply on fields
diff -r 41bae0ca6718 -r 8baafacac571 trytond/ir/ui/form.rnc
--- a/trytond/ir/ui/form.rnc Mon Oct 11 15:14:57 2021 +0200
+++ b/trytond/ir/ui/form.rnc Mon Oct 11 22:53:02 2021 +0200
@@ -91,6 +91,10 @@
attlist.field &=
[ a:defaultValue = "0" ] attribute invisible { "0" | "1" }?
attlist.field &=
+ [ a:defaultValue = "1" ] attribute create { "0" | "1" }?
+attlist.field &=
+ [ a:defaultValue = "1" ] attribute delete { "0" | "1" }?
+attlist.field &=
[ a:defaultValue = "left_to_right" ] attribute orientation {
"left_to_right"
| "right_to_left"
diff -r 41bae0ca6718 -r 8baafacac571 trytond/ir/ui/form.rng
--- a/trytond/ir/ui/form.rng Mon Oct 11 15:14:57 2021 +0200
+++ b/trytond/ir/ui/form.rng Mon Oct 11 22:53:02 2021 +0200
@@ -382,6 +382,28 @@
</define>
<define name="attlist.field" combine="interleave">
<optional>
+ <attribute a:defaultValue="1">
+ <name ns="">create</name>
+ <choice>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
+ <define name="attlist.field" combine="interleave">
+ <optional>
+ <attribute a:defaultValue="1">
+ <name ns="">delete</name>
+ <choice>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
+ <define name="attlist.field" combine="interleave">
+ <optional>
<attribute a:defaultValue="left_to_right">
<name ns="">orientation</name>
<choice>
diff -r 41bae0ca6718 -r 8baafacac571 trytond/ir/ui/tree.rnc
--- a/trytond/ir/ui/tree.rnc Mon Oct 11 15:14:57 2021 +0200
+++ b/trytond/ir/ui/tree.rnc Mon Oct 11 22:53:02 2021 +0200
@@ -52,6 +52,10 @@
attlist.field &= attribute width { text }?
attlist.field &= attribute height { text }?
attlist.field &=
+ [ a:defaultValue = "1" ] attribute create { "0" | "1" }?
+attlist.field &=
+ [ a:defaultValue = "1" ] attribute delete { "0" | "1" }?
+attlist.field &=
[ a:defaultValue = "left_to_right" ] attribute orientation {
"left_to_right"
| "right_to_left"
diff -r 41bae0ca6718 -r 8baafacac571 trytond/ir/ui/tree.rng
--- a/trytond/ir/ui/tree.rng Mon Oct 11 15:14:57 2021 +0200
+++ b/trytond/ir/ui/tree.rng Mon Oct 11 22:53:02 2021 +0200
@@ -191,6 +191,28 @@
</define>
<define name="attlist.field" combine="interleave">
<optional>
+ <attribute a:defaultValue="1">
+ <name ns="">create</name>
+ <choice>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
+ <define name="attlist.field" combine="interleave">
+ <optional>
+ <attribute a:defaultValue="1">
+ <name ns="">delete</name>
+ <choice>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
+ <define name="attlist.field" combine="interleave">
+ <optional>
<attribute a:defaultValue="left_to_right">
<name ns="">orientation</name>
<choice>