XML data depends not skip menu when is not installed
Hie,
I have a XML with depends that add a menu when a module is installed:
<tryton>
<data depends="purchase">
<menuitem
id="menu_act_searching_purchase"
parent="purchase.menu_purchase"
action="searching.act_searching"
icon="tryton-find"/>
</data>
</tryton>
When I update a database and "purchase" module is not installed, I get error:
9481 139937737017152 [2016-01-13 11:58:35,345] ERROR trytond.convert Error while parsing xml file:
Tag menuitem with id: menu_act_searching_purchase
Traceback (most recent call last):
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 447, in parse_xmlstream
self.sax_parser.parse(source)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 304, in start_element
self._cont_handler.startElement(name, AttributesImpl(attrs))
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 463, in startElement
self.taghandler.startElement(name, attributes)
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 60, in startElement
values['parent'] = self.mh.get_id(values['parent'])
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 528, in get_id
% ".".join([module, xml_id]))
Exception: Reference to purchase.menu_purchase not found
Traceback (most recent call last):
File "./trytond/bin/trytond", line 80, in <module>
server.TrytonServer(options).run()
File "/home/resteve/virtualenv/try38/trytond/trytond/server.py", line 112, in run
Pool(db_name).init(update=self.options.update, lang=lang)
File "/home/resteve/virtualenv/try38/trytond/trytond/pool.py", line 155, in init
lang=lang)
File "/home/resteve/virtualenv/try38/trytond/trytond/modules/__init__.py", line 427, in load_modules
_load_modules()
File "/home/resteve/virtualenv/try38/trytond/trytond/modules/__init__.py", line 394, in _load_modules
load_module_graph(graph, pool, update, lang)
File "/home/resteve/virtualenv/try38/trytond/trytond/modules/__init__.py", line 248, in load_module_graph
tryton_parser.parse_xmlstream(fp)
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 447, in parse_xmlstream
self.sax_parser.parse(source)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 304, in start_element
self._cont_handler.startElement(name, AttributesImpl(attrs))
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 463, in startElement
self.taghandler.startElement(name, attributes)
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 60, in startElement
values['parent'] = self.mh.get_id(values['parent'])
File "/home/resteve/virtualenv/try38/trytond/trytond/convert.py", line 528, in get_id
% ".".join([module, xml_id]))
Exception: Reference to purchase.menu_purchase not found
I debug and I found that startElement() in MenuitemTagHandler not check skip_data.
http://hg.tryton.org/trytond/file/65b6509a4c4d/trytond/convert.py#l45
I try replace menuitem to a xml group definition, and work successfully, but not with menus.