changeset da6e03207a48 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=da6e03207a48
description:
        Manage readonly dates and editable calendar view

        If any of the dates is readonly, the event can not be modified by drag 
and
        drop.
        If the calendar is not editable no events can be modified.

        issue9012
        review256451002
diffstat:

 CHANGELOG                  |   1 +
 doc/topics/views/index.rst |   3 +++
 trytond/ir/ui/calendar.rnc |   1 +
 trytond/ir/ui/calendar.rng |  11 +++++++++++
 4 files changed, 16 insertions(+), 0 deletions(-)

diffs (53 lines):

diff -r 7b714a61d567 -r da6e03207a48 CHANGELOG
--- a/CHANGELOG Thu Feb 27 19:08:35 2020 +0100
+++ b/CHANGELOG Sat Feb 29 23:43:50 2020 +0100
@@ -1,3 +1,4 @@
+* Add editable on calendar view
 * Add xalign and yalign to group
 * Add MultiSelection entry to Dict field
 * Allow empty order clause
diff -r 7b714a61d567 -r da6e03207a48 doc/topics/views/index.rst
--- a/doc/topics/views/index.rst        Thu Feb 27 19:08:35 2020 +0100
+++ b/doc/topics/views/index.rst        Sat Feb 29 23:43:50 2020 +0100
@@ -830,6 +830,9 @@
       Available views are: `day`, `week` and `month`. The default value is 
       `month`.
 
+    * ``editable``: A boolean to specify if the calendar is editable. The
+      default value is `True`.
+
     * ``color``: An optional field name that contains the text color for the
       event. The default value is `black`.
 
diff -r 7b714a61d567 -r da6e03207a48 trytond/ir/ui/calendar.rnc
--- a/trytond/ir/ui/calendar.rnc        Thu Feb 27 19:08:35 2020 +0100
+++ b/trytond/ir/ui/calendar.rnc        Sat Feb 29 23:43:50 2020 +0100
@@ -9,6 +9,7 @@
   attribute mode { "day"
       | "week"
       | "month" }?
+attlist.calendar &= [a:defaultValue = "1" ] attribute editable { "0" | "1" }?
 attlist.calendar &=
    [ a:defaultValue = "black" ] attribute color { text }?
 attlist.calendar &=
diff -r 7b714a61d567 -r da6e03207a48 trytond/ir/ui/calendar.rng
--- a/trytond/ir/ui/calendar.rng        Thu Feb 27 19:08:35 2020 +0100
+++ b/trytond/ir/ui/calendar.rng        Sat Feb 29 23:43:50 2020 +0100
@@ -38,6 +38,17 @@
   </define>
   <define name="attlist.calendar" combine="interleave">
     <optional>
+      <attribute a:defaultValue="1">
+        <name ns="">editable</name>
+        <choice>
+          <value>0</value>
+          <value>1</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="attlist.calendar" combine="interleave">
+    <optional>
       <attribute a:defaultValue="black">
         <name ns="">color</name>
         <text/>

Reply via email to