[IMP] rng of field tag in data xml

also fix nonsensical XML files specifying @ref and @model

bzr revid: xmo@openerp.com-20130429122423-qubsy2ccwo5tb8bq
This commit is contained in:
Xavier Morel 2013-04-29 14:24:23 +02:00
parent ffebb64472
commit de13720f0e
4 changed files with 75 additions and 27 deletions

View File

@ -297,7 +297,7 @@
<record id="property_rule" model="ir.rule">
<field name="name">Property multi-company</field>
<field model="ir.model" name="model_id" ref="model_ir_property"/>
<field name="model_id" ref="model_ir_property"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>

View File

@ -4,7 +4,7 @@
<!-- Restrict modifications on ir.filters to owner only -->
<record id="ir_filters_rule" model="ir.rule">
<field name="name">ir.filters.owner</field>
<field model="ir.model" name="model_id" ref="model_ir_filters"/>
<field name="model_id" ref="model_ir_filters"/>
<field name="domain_force">[('user_id','in',[False,user.id])]</field>
</record>
</data>

View File

@ -16,7 +16,7 @@
<!-- Record Rule For Company -->
<record id="res_company_rule" model="ir.rule">
<field name="name">company rule</field>
<field model="ir.model" name="model_id" ref="model_res_company"/>
<field name="model_id" ref="model_res_company"/>
<field eval="True" name="global"/>
<!-- TODO: review this <field name="domain_force">['|', ('child_ids', 'child_of', [user.company_id.id]), ('parent_id', 'child_of', [user.company_id.id])]</field> -->
<field name="domain_force">[('id','child_of',[user.company_id.id])]</field>
@ -25,7 +25,7 @@
<!-- Record Rule For User -->
<record id="res_users_rule" model="ir.rule">
<field name="name">user rule</field>
<field model="ir.model" name="model_id" ref="model_res_users"/>
<field name="model_id" ref="model_res_users"/>
<field eval="True" name="global"/>
<field name="domain_force">[('company_ids','child_of',[user.company_id.id])]</field>
</record>

View File

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0">
<rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<rng:define name="any">
<rng:element>
<rng:anyName/>
<rng:zeroOrMore>
<rng:choice>
<rng:attribute>
<rng:element>
<rng:anyName/>
</rng:attribute>
<rng:text/>
<rng:ref name="any"/>
</rng:choice>
</rng:zeroOrMore>
<rng:zeroOrMore>
<rng:choice>
<rng:attribute>
<rng:anyName/>
</rng:attribute>
<rng:text/>
<rng:ref name="any"/>
</rng:choice>
</rng:zeroOrMore>
</rng:element>
</rng:define>
@ -125,19 +126,66 @@
<rng:define name="field">
<rng:element name="field">
<rng:attribute name="name" />
<rng:optional><rng:attribute name="type"/></rng:optional>
<rng:optional><rng:attribute name="ref"/></rng:optional>
<rng:optional><rng:attribute name="eval"/></rng:optional>
<rng:optional><rng:attribute name="domain"/></rng:optional>
<rng:optional><rng:attribute name="search"/></rng:optional>
<rng:optional><rng:attribute name="model"/></rng:optional>
<rng:optional><rng:attribute name="use"/></rng:optional>
<rng:oneOrMore>
<rng:choice>
<rng:ref name="any"/>
<rng:choice>
<rng:group>
<rng:attribute name="type">
<rng:choice>
<rng:value>char</rng:value>
<rng:value>file</rng:value>
</rng:choice>
</rng:attribute>
<rng:text/>
</rng:choice>
</rng:oneOrMore>
</rng:group>
<rng:group>
<rng:attribute name="type"><rng:value>int</rng:value></rng:attribute>
<rng:choice>
<rng:data type="int"/>
<rng:value>None</rng:value>
</rng:choice>
</rng:group>
<rng:group>
<rng:attribute name="type"><rng:value>float</rng:value></rng:attribute>
<rng:data type="float"/>
</rng:group>
<rng:group>
<rng:attribute name="type">
<rng:choice>
<rng:value>list</rng:value>
<rng:value>tuple</rng:value>
</rng:choice>
</rng:attribute>
<rng:oneOrMore><rng:ref name="value"/></rng:oneOrMore>
</rng:group>
<rng:group>
<rng:attribute name="type">
<rng:choice>
<rng:value>html</rng:value>
<rng:value>xml</rng:value>
</rng:choice>
</rng:attribute>
<rng:oneOrMore>
<rng:ref name="any"/>
</rng:oneOrMore>
</rng:group>
<rng:group>
<rng:attribute name="ref"/>
<rng:empty/>
</rng:group>
<rng:group>
<rng:attribute name="eval"/>
<rng:optional><rng:attribute name="model"/></rng:optional>
<rng:empty/>
</rng:group>
<rng:group>
<rng:attribute name="search"/>
<rng:attribute name="model"/>
<rng:optional><rng:attribute name="use"/></rng:optional>
<rng:empty/>
</rng:group>
<rng:group>
<rng:text/>
</rng:group>
</rng:choice>
</rng:element>
</rng:define>