Skip to Content
Menu
This question has been flagged
2 Replies
2102 Views

Hello,

I  was playing around in the technical settings trying to modify reports and I seem to have broken something. Any advice or insight is greatly appreciated. Whenever I try to print a quote or confirm a sale from the sales and crm modules I get the following error:



Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 88, in lookup
    r = d [key]
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 69, in wrapper
    return func (self, * args, ** kwargs)
  File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 44, in __getitem__
    a = self.d [obj] .me
KeyError: ('ir.ui.view', <function View.get_view_id at 0x7fa25472ec80>, 2, 'sale.report_saleorder', (None,))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1673, in report_download
    response = self.report_routes (reportname, docids = docids, converter = converter)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 517, in response_wrap
    response = f (* args, ** kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1614, in report_routes
    pdf = report.with_context (context) .render_qweb_pdf (docids, data = data) [0]
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 669, in render_qweb_pdf
    html = self.with_context (context) .render_qweb_html (res_ids, data = data) [0]
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 703, in render_qweb_html
    return self.render_template (self.report_name, data), 'html'
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_actions_report.py", line 493, in render_template
    return view_obj.render_template (template, values)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1276, in render_template
    return self.browse (self.get_view_id (template)). render (values, engine)
  File "<decorator-gen-231>", line 2, in get_view_id
  File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 93, in lookup
    value = d [key] = self.method (* args, ** kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 207, in get_view_id
    return super (View, self) .get_view_id (xml_id)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 1183, in get_view_id
    return view and view.id or self.env ['ir.model.data']. xmlid_to_res_id (template, raise_if_not_found = True)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 2811, in __get__
    raise ValueError ("Expected singleton:% s"% record)
ValueError: Expected singleton: ir.ui.view (1192, 2279, 2282)
Avatar
Discard

That worked, how did you know which views to delete?

It is given in the error already.

ValueError: Expected singleton: ir.ui.view (1192, 2279, 2282)

I assumed that 1192 is the original view and other ones have greater value in the ID (2279, 2282)

Best Answer

It seems you have created multiple views for the report / view. You need to delete what you have created.

Start the developer mode and go to "Settings / User Interface / Views" and open any record. Now when record is opened, you will see "id=" in the URL bar of the browser.

Ex: http://localhost:8069/web?&debug=#id=216&view_type=form&model=ir.ui.view

Now change the id to 2279 and press enter which will open the record which I think you created manually. Now delete that record and do the similar for 2282 id and delete that record as well.

Once they both are deleted, try to print the report again.

Let me know if you still having this issue.

Avatar
Discard