Hello, when I reach a certain page in my website it gives me an error.
Model:
from openerp import models, fields, api
class test_sale_order(models.Model):
_name = "_order"
order_date = fields.Text(required=True)
The Important Part of the View:
<div class="row form-group">
<div class="input-group">
<div t-field="odss_order.order_date"/>
</div>
</div>
</div>
Error:
'NoneType' object has no attribute '_fields'
Traceback:
Traceback (most recent call last): File "/opt/odoo/addons/website/models/ir_http.py", line 243, in _handle_exception response = super(ir_http, self)._handle_exception(exception) File "/opt/odoo/openerp/addons/base/ir/ir_http.py", line 157, in _handle_exception return request._handle_exception(exception) File "/opt/odoo/openerp/http.py", line 784, in _handle_exception return super(HttpRequest, self)._handle_exception(exception) File "/opt/odoo/openerp/addons/base/ir/ir_http.py", line 182, in _dispatch result = request.dispatch() File "/opt/odoo/openerp/http.py", line 843, in dispatch r = self._call_function(**self.params) File "/opt/odoo/openerp/http.py", line 319, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/openerp/service/model.py", line 118, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/openerp/http.py", line 315, in checked_call result.flatten() File "/opt/odoo/openerp/http.py", line 1444, in flatten self.response.append(self.render()) File "/opt/odoo/openerp/http.py", line 1437, in render context=request.context) File "/opt/odoo/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/addons/website/models/ir_ui_view.py", line 166, in render return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context) File "/opt/odoo/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/addons/web_editor/models/ir_ui_view.py", line 29, in render return super(view, self).render(cr, uid, id_or_xml_id, values=values, engine=engine, context=context) File "/opt/odoo/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/openerp/addons/base/ir/ir_ui_view.py", line 1074, in render return self.pool[engine].render(cr, uid, id_or_xml_id, qcontext, loader=loader, context=context) File "/opt/odoo/openerp/api.py", line 250, in wrapper return old_api(self, *args, **kwargs) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 254, in render return self.render_node(element, qwebcontext, generated_attributes=qwebcontext.pop('generated_attributes', '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 295, in render_node result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 448, in render_tag_call d[0] = self.render_element(element, template_attributes, generated_attributes, d) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 297, in render_node result = self.render_element(element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 325, in render_element raise_qweb_exception(message="Could not render element %r" % element.tag, node=element, template=template) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 320, in render_element generated_attributes= name == "t" and generated_attributes or '')) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 295, in render_node result = self._render_tag[t_render](self, element, template_attributes, generated_attributes, qwebcontext) File "/opt/odoo/openerp/addons/base/ir/ir_qweb.py", line 503, in render_tag_field field = record._fields[field_name] QWebException: 'NoneType' object has no attribute '_fields'
QWeb:
Could not render element 'div'
The error occured while rendering the template 900
<div class="input-group"> <div t-field="odss_order.order_date"/> </div>
The class in the model is called odss_sale_order not test_sale_order
and its name is sale_order not _order
Did You Sort This out ??? . If You do please Share how you did it .And what was the issue
Yes, I did. However this was a very long time ago and I don't even use odoo anymore. So I just really don't remember. Sorry.