[ADD] Pseudo `clone` mode for <templates> using primary="True"
When @primary="True" is present on <template> tag, we'll set the t-name to the full canonical xmlid of current template (@id) Providing a "kind of" clone mode for templates.
This commit is contained in:
parent
df78e58df2
commit
619ee620f7
|
@ -898,6 +898,14 @@ form: module.record_id""" % (xml_id,)
|
||||||
if el.attrib.pop('page', None) == 'True':
|
if el.attrib.pop('page', None) == 'True':
|
||||||
record.append(Field(name="page", eval="True"))
|
record.append(Field(name="page", eval="True"))
|
||||||
if el.get('primary') == 'True':
|
if el.get('primary') == 'True':
|
||||||
|
# Pseudo clone mode, we'll set the t-name to the full canonical xmlid
|
||||||
|
el.append(
|
||||||
|
builder.E.xpath(
|
||||||
|
builder.E.attribute(full_tpl_id, name='t-name'),
|
||||||
|
expr=".",
|
||||||
|
position="attributes",
|
||||||
|
)
|
||||||
|
)
|
||||||
record.append(Field('primary', name='mode'))
|
record.append(Field('primary', name='mode'))
|
||||||
if el.get('optional'):
|
if el.get('optional'):
|
||||||
record.append(Field(el.get('optional'), name='application'))
|
record.append(Field(el.get('optional'), name='application'))
|
||||||
|
|
Loading…
Reference in New Issue