2016-07-13 8 views
0

私はOdoo v9を使用してウェブサイトを作成しています。私のウェブサイト(/ order/time)のページの1つにナビゲートすると、 。'NoneType'オブジェクトに '_fields'属性(odoo)がありません

モデル:

from openerp import models, fields, api 
    class odss_sale_order(models.Model): 
     _name = "_order" 
     order_date = fields.Text(required=True) 

ビューの重要な部分:

<div class="row form-group"> 
    <div class="input-group"> 
     <div t-field="odss_order.order_date"/> 
     </div> 
    </div> 
</div> 

エラー:

'NoneType' object has no attribute '_fields'

トレースバック:

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_sale_order.order_date"/></div> 

何が問題であり、私はそれをどのように修正するのですか?事前に

おかげで、 ハムザTahboub

+0

カスタムレポートですか...「get_html」をオーバーライドしましたか? – danidee

答えて

0

あなたがPYファイルのあなたの一番上にこの行をadddingでみました。

from openerp import models, fields, api, _

が、これはそれを解決することを願っています。

ありがとう、 Chandni。

関連する問題