This question has been flagged
2 Replies
2039 Views

I have Odoo 11 on local environment. When trying to install contact form, i get error message. What should i do?

Odoo Server Error
Traceback (most recent call last):
  File "/Users/jaanarantala/odoo/odoo/tools/cache.py", line 84, in lookup
    r = d[key]
  File "/Users/jaanarantala/odoo/odoo/tools/func.py", line 68, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/jaanarantala/odoo/odoo/tools/lru.py", line 44, in __getitem__
    a = self.d[obj].me
KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x105054268>, 'website.contactus')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 719, in _tag_template
    return self._tag_record(record, data_node)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 639, in _tag_record
    f_val = self.id_get(f_ref)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 724, in id_get
    res = self.model_id_get(id_str, raise_if_not_found)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 730, in model_id_get
    return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
  File "/Users/jaanarantala/odoo/odoo/addons/base/ir/ir_model.py", line 1323, in xmlid_to_res_model_res_id
    return self.xmlid_lookup(xmlid)[1:3]
  File "<decorator-gen-21>", line 2, in xmlid_lookup
  File "/Users/jaanarantala/odoo/odoo/tools/cache.py", line 89, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/Users/jaanarantala/odoo/odoo/addons/base/ir/ir_model.py", line 1312, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: website.contactus

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jaanarantala/odoo/odoo/http.py", line 650, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/Users/jaanarantala/odoo/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/Users/jaanarantala/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/Users/jaanarantala/odoo/odoo/http.py", line 692, in dispatch
    result = self._call_function(**self.params)
  File "/Users/jaanarantala/odoo/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/Users/jaanarantala/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/Users/jaanarantala/odoo/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/Users/jaanarantala/odoo/odoo/http.py", line 936, in __call__
    return self.method(*args, **kw)
  File "/Users/jaanarantala/odoo/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/Users/jaanarantala/odoo/addons/web/controllers/main.py", line 934, in call_button
    action = self._call_kw(model, method, args, {})
  File "/Users/jaanarantala/odoo/addons/web/controllers/main.py", line 922, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/Users/jaanarantala/odoo/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/Users/jaanarantala/odoo/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-40>", line 2, in button_immediate_install
  File "/Users/jaanarantala/odoo/odoo/addons/base/module/module.py", line 71, in check_and_log
    return method(self, *args, **kwargs)
  File "/Users/jaanarantala/odoo/odoo/addons/base/module/module.py", line 448, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/Users/jaanarantala/odoo/odoo/addons/base/module/module.py", line 541, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/Users/jaanarantala/odoo/odoo/modules/registry.py", line 85, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/Users/jaanarantala/odoo/odoo/modules/loading.py", line 343, in load_modules
    loaded_modules, update_module)
  File "/Users/jaanarantala/odoo/odoo/modules/loading.py", line 242, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/Users/jaanarantala/odoo/odoo/modules/loading.py", line 156, in load_module_graph
    _load_data(cr, module_name, idref, mode, kind='data')
  File "/Users/jaanarantala/odoo/odoo/modules/loading.py", line 94, in _load_data
    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 788, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 849, in convert_xml_import
    obj.parse(doc.getroot(), mode=mode)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 748, in parse
    exc_info[2]
  File "/Users/jaanarantala/odoo/odoo/tools/pycompat.py", line 86, in reraise
    raise value.with_traceback(tb)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 741, in parse
    self._tags[rec.tag](rec, de, mode=mode)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 719, in _tag_template
    return self._tag_record(record, data_node)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 639, in _tag_record
    f_val = self.id_get(f_ref)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 724, in id_get
    res = self.model_id_get(id_str, raise_if_not_found)
  File "/Users/jaanarantala/odoo/odoo/tools/convert.py", line 730, in model_id_get
    return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
  File "/Users/jaanarantala/odoo/odoo/addons/base/ir/ir_model.py", line 1323, in xmlid_to_res_model_res_id
    return self.xmlid_lookup(xmlid)[1:3]
  File "<decorator-gen-21>", line 2, in xmlid_lookup
  File "/Users/jaanarantala/odoo/odoo/tools/cache.py", line 89, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/Users/jaanarantala/odoo/odoo/addons/base/ir/ir_model.py", line 1312, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
odoo.tools.convert.ParseError: "External ID not found in the system: website.contactus" while parsing None:3, near
<data name="Contact Form" inherit_id="website.contactus" customize_show="True">
            <xpath expr="//div[@name='mail_button']" position="replace">
                <div>
                    <form action="/website/form/" method="post" data-model_name="crm.lead" data-success_page="/contactus-thank-you" class="s_website_form form-horizontal container-fluid mt32" enctype="multipart/form-data" data-editable-form="false">
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="contact_name">Your Name</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="contact_name" t-att-value="request.params.get('contact_name', '')" required=""/>
                            </div>
                        </div>
                        <div class="form-group form-field">
                            <label class="col-md-3 col-sm-4 control-label" for="phone">Phone Number</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="phone" t-att-value="request.params.get('phone', '')"/>
                            </div>
                        </div>
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="email_from">Email</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="email_from" required="" t-att-value="request.params.get('email_from', '')"/>
                            </div>
                        </div>
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="partner_name">Your Company</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="partner_name" required="" t-att-value="request.params.get('partner_name', '')"/>
                            </div>
                        </div>
                        <div class="form-group form-field o_website_form_required">
                            <label class="col-md-3 col-sm-4 control-label" for="name">Subject</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="name" required="" t-att-value="request.params.get('name', '')"/>
                            </div>
                        </div>
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="description">Your Question</label>
                            <div class="col-md-7 col-sm-8">
                                <textarea class="form-control o_website_form_input" name="description" required=""><t t-esc="request.params.get('description', '')"/></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
                                <span class="btn btn-primary btn-lg o_website_form_send">Send</span>
                                <span id="o_website_form_result"/>
                            </div>
                        </div>
                    </form>
                </div>
			</xpath>
		</data>

Avatar
Discard
Best Answer

somehow that contact form view definition has been deleted from views. what you can do is forced upgrade

stop odoo and execute it with:

/path/to/odoo-bin --your-other-parameters  -i base -u all --stop-after-init

delete all sessions files, cached .py __pycache__ files. then start normally and go on.

Avatar
Discard
Author Best Answer

Are those commands for mac too? I haven't really used command line and might be that i did something wrong but it gave message that "command not found". Should I give that command in odoo folder or how? 

Avatar
Discard

these commands for odoo itself, not OS specific. odoo-bin actually refers to odoo startup script.

if you still can't figure out where these args are going, just Update website module from settings panel. it should do the same job.