当前位置:  开发笔记 > 编程语言 > 正文

引发ValueError('在系统中找不到外部ID:%s'%xmlid)

如何解决《引发ValueError('在系统中找不到外部ID:%s'%xmlid)》经验,为你挑选了1个好方法。

我正在尝试为"每日交易"创建一个模块ValueError并获得评估错误

    value = d[key] = self.method(*args, **kwargs)
  File "/home/odoo/odoo-dev/odoo/odoo/addons/base/ir/ir_model.py", line 1028, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ParseError: "External ID not found in the system: daily_transaction.action_daily_transaction" while parsing /home/odoo/odoo-dev/custom-addons/daily_transaction/daily_transaction_view.xml:11, near 

/home/odoo/odoo-dev/custom-addons/daily_transaction/daily_transaction_view.xml:11,近

我的文件结构:(一个用Bold是我的文件名)

__init__.py

from import daily_transaction

__manifest__.py

{
        'name':'Daily Transaction Manager',
        'version':'1.0',
        'description':'**********************This app will keep the record of all the tansactions happening*********',
        'author':'Test',
        'data':['daily_transaction_view.xml'],
        'installable':True,
        'auto_install':False,
}

daily_transaction.py

from . import fields,osv

class daily_transaction(osv.osv):
        _name = 'daily.transaction'
        _description = 'Daily Transaction'
        _columns = {

                'subject': fields.char('Subject', size=128, required = True),
                'data' : fields.data('Date', required = True),
                'note': fields.text('Notes'),
                'amount': fields.float('Amount', required = True),
                'type' : fields.selection([
                        ('transport','Transport'),
                        ('household','Household'),
                        ('personal','Personal'),
                        ],
                        'Type', required = True),
                        }

daily_transaction_view.xml






        

       
 
       


    
  
daily.transaction.tree         
daily.transaction    
           
             
               
                
               
               
                
                   
       




    
        
daily.transaction.form.view        
daily.transaction        
            
            
Daily Transaction daily.transaction form tree,form {} Create new daily transaction.

>



1> Emipro Techn..:

它是在给出此错误,因为您在创建之前使用了操作,因此首先您必须定义操作然后才能使用它.

所以你应该尝试如下:

        
    Daily Transaction        
    daily.transaction        
    form        
    tree,form        
            
    {}        
    Create new daily transaction.    



推荐阅读
linjiabin43
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有