trytond-patches/issue10061002_1.diff
Sergi Almacellas Abellana ba3ddf39d4 Add patch for issue4473
2015-01-09 17:08:02 +01:00

84 lines
2.2 KiB
Diff

# HG changeset patch
# User Sergi Almacellas Abellana <sergi@koolpi.com>
Allow to apply inheritance in calendar view
review10061002
Index: trytond/trytond/ir/ui/calendar.rnc
===================================================================
--- a/trytond/trytond/ir/ui/calendar.rnc
+++ b/trytond/trytond/ir/ui/calendar.rnc
@@ -9,4 +9,14 @@
[ a:defaultValue = "Unknown" ] attribute string { text }?
field = element field { attlist.field, empty }
attlist.field &= attribute name { text }
-start = calendar
+data = element data { attlist.data, xpath* }
+attlist.data &= empty
+
+xpath = element xpath { attlist.xpath, ( field )*
+ }
+attlist.xpath &= attribute expr { text }
+attlist.xpath &=
+ [ a:defaultValue = "inside" ]
+ attribute position { "inside" | "replace" | "replace_attributes" | "after" | "before" }?
+
+start = data | calendar
Index: trytond/trytond/ir/ui/calendar.rng
===================================================================
--- a/trytond/trytond/ir/ui/calendar.rng
+++ b/trytond/trytond/ir/ui/calendar.rng
@@ -30,7 +30,47 @@
<define name="attlist.field" combine="interleave">
<attribute name="name"/>
</define>
+ <define name="data">
+ <element name="data">
+ <ref name="attlist.data"/>
+ <zeroOrMore>
+ <ref name="xpath"/>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="attlist.data" combine="interleave">
+ <empty/>
+ </define>
+ <define name="xpath">
+ <element name="xpath">
+ <ref name="attlist.xpath"/>
+ <zeroOrMore>
+ <choice>
+ <ref name="field"/>
+ </choice>
+ </zeroOrMore>
+ </element>
+ </define>
+ <define name="attlist.xpath" combine="interleave">
+ <attribute name="expr"/>
+ </define>
+ <define name="attlist.xpath" combine="interleave">
+ <optional>
+ <attribute name="position" a:defaultValue="inside">
+ <choice>
+ <value>inside</value>
+ <value>replace</value>
+ <value>replace_attributes</value>
+ <value>after</value>
+ <value>before</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
<start>
- <ref name="calendar"/>
+ <choice>
+ <ref name="data"/>
+ <ref name="calendar"/>
+ </choice>
</start>
</grammar>