[ADD] page attribute to views
This can be used to distinguish template views expected to be available as web pages, and thus directly linkable. By opposition to non-web views and template sections (reusables). bzr revid: xmo@openerp.com-20130821121206-ebxsxrmyogcv7pnv
This commit is contained in:
parent
4a4169ba75
commit
d8bf3892f3
|
@ -82,9 +82,11 @@ class view(osv.osv):
|
||||||
'groups_id': fields.many2many('res.groups', 'ir_ui_view_group_rel', 'view_id', 'group_id',
|
'groups_id': fields.many2many('res.groups', 'ir_ui_view_group_rel', 'view_id', 'group_id',
|
||||||
string='Groups', help="If this field is empty, the view applies to all users. Otherwise, the view applies to the users of those groups only."),
|
string='Groups', help="If this field is empty, the view applies to all users. Otherwise, the view applies to the users of those groups only."),
|
||||||
'model_ids': fields.one2many('ir.model.data', 'res_id', auto_join=True),
|
'model_ids': fields.one2many('ir.model.data', 'res_id', auto_join=True),
|
||||||
|
'page': fields.boolean("Whether this view is a web page template (complete)"),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'priority': 16,
|
'priority': 16,
|
||||||
|
'page': False,
|
||||||
}
|
}
|
||||||
_order = "priority,name"
|
_order = "priority,name"
|
||||||
|
|
||||||
|
|
|
@ -204,11 +204,18 @@
|
||||||
|
|
||||||
<rng:define name="template">
|
<rng:define name="template">
|
||||||
<rng:element name="template">
|
<rng:element name="template">
|
||||||
|
<rng:optional><rng:attribute name="id"/></rng:optional>
|
||||||
|
<rng:optional><rng:attribute name="t-name"/></rng:optional>
|
||||||
|
<rng:optional><rng:attribute name="name"/></rng:optional>
|
||||||
|
<rng:optional><rng:attribute name="inherit_id"/></rng:optional>
|
||||||
|
<rng:optional><rng:attribute name="inherit_option_id"/></rng:optional>
|
||||||
|
<rng:optional><rng:attribute name="forcecreate"/></rng:optional>
|
||||||
|
<rng:optional><rng:attribute name="context"/></rng:optional>
|
||||||
|
<rng:optional>
|
||||||
|
<rng:attribute name="page"><rng:value>True</rng:value></rng:attribute>
|
||||||
|
</rng:optional>
|
||||||
<rng:zeroOrMore>
|
<rng:zeroOrMore>
|
||||||
<rng:choice>
|
<rng:choice>
|
||||||
<rng:attribute>
|
|
||||||
<rng:anyName/>
|
|
||||||
</rng:attribute>
|
|
||||||
<rng:text/>
|
<rng:text/>
|
||||||
<rng:ref name="any"/>
|
<rng:ref name="any"/>
|
||||||
</rng:choice>
|
</rng:choice>
|
||||||
|
|
|
@ -872,6 +872,8 @@ form: module.record_id""" % (xml_id,)
|
||||||
if el.get(key):
|
if el.get(key):
|
||||||
record.append(etree.fromstring('<field name="%s" ref="%s"/>' % (key, el.get(key))))
|
record.append(etree.fromstring('<field name="%s" ref="%s"/>' % (key, el.get(key))))
|
||||||
el.attrib.pop(key, None)
|
el.attrib.pop(key, None)
|
||||||
|
if el.get('page'):
|
||||||
|
record.append(etree.Element('field', name="page", eval="True"))
|
||||||
return self._tag_record(cr, record, data_node)
|
return self._tag_record(cr, record, data_node)
|
||||||
|
|
||||||
def id_get(self, cr, id_str):
|
def id_get(self, cr, id_str):
|
||||||
|
|
Loading…
Reference in New Issue