Error during upgrading the module

Hi people , i was about upgrading a module but their were errors in the record of the button
this the code xml :

 <record model="ir.model.button" id="party_upload_class_button">
<field name="name">upload_cls</field>
<field name="string">upload_cls</field>
<field name="model" search="[('model', '=', 'party.wps')]"/>
</record>  


when i typed the command on linux :trytond/bin/trytond-admin -c trytond.conf --all -d testd -vv, it told me this error :


In tag record model ir.model.button with id namemodule.party_upload_class_button.
Traceback (most recent call last):
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 456, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "../Modules/pyexpat.c", line 417, in StartElement
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 333, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 492, in startElement
    self.taghandler.startElement(name, attributes)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 228, in startElement
    found, = SearchModel.search(eval(search_attr))
ValueError: not enough values to unpack (expected 1, got 0)
Traceback (most recent call last):
  File "trytond/bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/admin.py", line 53, in run
    activatedeps=options.activatedeps)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/pool.py", line 160, in init
    lang=lang, activatedeps=activatedeps)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/modules/__init__.py", line 420, in load_modules
    _load_modules(update)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/modules/__init__.py", line 390, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/modules/__init__.py", line 232, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 456, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "../Modules/pyexpat.c", line 417, in StartElement
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 333, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 492, in startElement
    self.taghandler.startElement(name, attributes)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 228, in startElement
    found, = SearchModel.search(eval(search_attr))
ValueError: not enough values to unpack (expected 1, got 0)

anyone can help me please is the code wml of the button wrong , !!! because when i disspear the code , the command work normal and how i can fix that

The error is raised because the tryton server does not find any model named party.wps

Normally the problem is because one of the following reasons:

  • The model name is wrong
  • The model is not registered on the pool (missing on __init__.py file)

Hope it helps!

1 Like

Thanks that u respond me, the problem was fixed , but now there is another error also about the menuitem during upgrading the code xml is:

<menuitem parent="menu_14555_d_wpqr_form" action="wizard_print_iso_wpqr2"
            id="menu_print_wpqr2" icon="tryton-print"/> 
<menuitem name = "EN ISO 14555-D" parent="menu_schweiss_wpqr_form" sequence="1"
             id="menu_14555_d_wpqr_form"/>
<menuitem name = "Creation of the certificate " parent="menu_14555_d_wpqr_form" sequence="1"
      action = "act_wpqr2_form"  id="Creation _wpqr2_form"/>  

when i typed the command on linux: trytond/bin/trytond-admin -c trytond.conf --all -d testd -vv, it told me this error: Tag menuitem with id namemodule.menu_print_wpqr2

Traceback (most recent call last):
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 456, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "../Modules/pyexpat.c", line 417, in StartElement
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 333, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 492, in startElement
    self.taghandler.startElement(name, attributes)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 62, in startElement
    values['parent'] = self.mh.get_id(values['parent'])
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 534, in get_id
    % ".".join([module, xml_id]))
Exception: Reference to namemodule.menu_14555_d_wpqr_form not found
Traceback (most recent call last):
  File "trytond/bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/admin.py", line 53, in run
    activatedeps=options.activatedeps)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/pool.py", line 160, in init
    lang=lang, activatedeps=activatedeps)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/modules/__init__.py", line 420, in load_modules
    _load_modules(update)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/modules/__init__.py", line 390, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/modules/__init__.py", line 232, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 456, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.7/xml/sax/xmlreader.py", line 125, in parse
    self.feed(buffer)
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 217, in feed
    self._parser.Parse(data, isFinal)
  File "../Modules/pyexpat.c", line 417, in StartElement
  File "/usr/lib/python3.7/xml/sax/expatreader.py", line 333, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 492, in startElement
    self.taghandler.startElement(name, attributes)
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 62, in startElement
    values['parent'] = self.mh.get_id(values['parent'])
  File "/home/dev/.virtualenvs/namepro/trytond/trytond/convert.py", line 534, in get_id
    % ".".join([module, xml_id]))
Exception: Reference to namemodule.menu_14555_d_wpqr_form not found

I want to know if u have an idea just what it can be the problem?

Now your problem is that you have set a parent xml_id which does not exist.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.