Odoo V9产品模板问题

时间:2016-03-14 14:42:28

标签: python xml openerp odoo-9

我试图对" products.template"进行一些简单的修改。

此后是.py

from openerp.osv import fields, osv

class myproducts_example(osv.osv):
    _inherit = 'product.template'

    _columns = {
        'price' : fields.float('PPH', digits=(6,4)),
        'example_id': fields.many2one('product.template', 'DCI'),
    }

以及我的xml文件

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
    <record model="ir.ui.view" id="view_product_form_inherit">
    <field name="name">product.template.form.myinherit</field>
    <field name="model">product.template</field>
    <field name="inherit_id" ref="product.product_template_only_form_view"/>
    <field name="arch" type="xml">
        <field name="standard_price" position="replace">
            <field name="sample" placeholder="e.g sample" />
        </field>             
        <field name="invoice_policy" position="replace"/>          
     </field> 
  </record>

一切正常,安装模块时没有错误,但是当我尝试更新模块时出现此错误。

Traceback (most recent call last):
File "/home/thinkmal/mcom-tests-env/lib/python2.7/site-packages/werkzeug/serving.py", line 177, in run_wsgi
   execute(self.server.app)
  File "/home/thinkmal/mcom-tests-env/lib/python2.7/site-packages/werkzeug/serving.py", line 165, in execute
application_iter = app(environ, start_response)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/service/server.py", line 245, in app
return self.app(e, s)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/service/wsgi_server.py", line 184, in application
return application_unproxied(environ, start_response)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/service/wsgi_server.py", line 170, in application_unproxied
result = handler(environ, start_response)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/http.py", line 1488, in __call__
return self.dispatch(environ, start_response)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/http.py", line 1462, in __call__
return self.app(environ, start_wrapped)
  File "/home/thinkmal/mcom-tests-env/lib/python2.7/site-packages/werkzeug/wsgi.py", line 588, in __call__
return self.app(environ, start_response)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/http.py", line 1637, in dispatch
ir_http = request.registry['ir.http']
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/http.py", line 360, in registry
return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/registry.py", line 354, in get
update_module)
  File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/registry.py", line 385, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
   File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/loading.py", line 334, in load_modules
force, status, report, loaded_modules, update_module)
   File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/loading.py", line 237, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
   File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/loading.py", line 132, in load_module_graph
models = registry.load(cr, package)
   File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/registry.py", line 168, in load
model = cls._build_model(self, cr)
   File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/models.py", line 592, in _build_model
original_module = pool[name]._original_module if name in parents else cls._module
   File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/modules/registry.py", line 84, in __getitem__
return self.models[model_name]
  KeyError: 'product.template'

我没有真正理解错误。

我试图删除该模块并重新安装。相同的行为:首先工作,之后是相同的消息错误。

我还尝试删除数据库并从头开始重启,当我点击库存时:我有此消息错误。

 File "/home/thinkmal/Desktop/odoo-9.0c-20160117/openerp/addons/base/ir/ir_ui_view.py", line 640, in read_combined
  view_arch = etree.fromstring(view['arch'].encode('utf-8'))
 File "lxml.etree.pyx", line 3092, in lxml.etree.fromstring (src/lxml/lxml.etree.c:70473)
 File "parser.pxi", line 1828, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:106307)
 File "parser.pxi", line 1716, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:105098)
 File "parser.pxi", line 1086, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:99780)
 File "parser.pxi", line 580, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:94254)
 File "parser.pxi", line 690, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:95690)
 File "parser.pxi", line 620, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:94757)
 XMLSyntaxError: Opening and ending tag mismatch: i line 186 and li, line 186, column 277
我完全失去了!请帮忙! :P

0 个答案:

没有答案