2014-05-25 41 views
0

我試圖建立我的模型和account.tax之間的many2many關係。Openerp說現有的模型不存在多種關係

我用下面列定義:

'tax_id': fields.many2many('account.tax', 'account_contract_line_tax', 'contract_line_id', 'tax_id', 'Taxes', domain=[('parent_id','=',False)]), 

而且我得到以下erorr:

2014-05-25 16:18:55,456 31937 ERROR ***_dev openerp.netsvc: Programming Error 
Many2Many destination model does not exist: `account.tax` 
Traceback (most recent call last): 
    File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc 
    result = ExportService.getService(service_name).dispatch(method, params) 
    File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 622, in dispatch 
    security.check(db,uid,passwd) 
    File "/usr/lib/pymodules/python2.7/openerp/service/security.py", line 40, in check 
    pool = pooler.get_pool(db) 
    File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 49, in get_pool 
    return get_db_and_pool(db_name, force_demo, status, update_module)[1] 
    File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 33, in get_db_and_pool 
    registry = RegistryManager.get(db_name, force_demo, status, update_module) 
    File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 203, in get 
    update_module) 
    File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 233, in new 
    openerp.modules.load_modules(registry.db, force_demo, status, update_module) 
    File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 350, in load_modules 
    force, status, report, loaded_modules, update_module) 
    File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 256, in load_marked_modules 
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) 
    File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 165, in load_module_graph 
    init_module_models(cr, package.name, models) 
    File "/usr/lib/pymodules/python2.7/openerp/modules/module.py", line 374, in init_module_models 
    result = obj._auto_init(cr, {'module': module_name}) 
    File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3028, in _auto_init 
    self._m2m_raise_or_create_relation(cr, f) 
    File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3338, in _m2m_raise_or_create_relation 
    raise except_orm('Programming Error', 'Many2Many destination model does not exist: `%s`' % (f._obj,)) 
except_orm: ('Programming Error', 'Many2Many destination model does not exist: `account.tax`') 

當然,account.tax是現有的,因爲我使用的ERP與賬​​戶模塊建立發票。此外,我可以看到在配置/數據庫結構模型/模型

我幾乎複製了帳戶模塊行...

任何想法?

A.

回答

1

好吧......

看來原因是缺乏明確的相關性在

__openerp__.py 

加入「帳戶」到依賴性列表後,它開始工作.. 。

最好的問候,

A.

相關問題