2017-01-17 12 views
-1

私は評価エラーをenter code here「毎日の取引」のためのモジュールを作成しようと取得しています昇給とValueError(「外部IDは、システムで見つかりません:%s」は%xmlid)

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 

/ホーム

近く/odoo/odoo-dev/custom-addons/daily_transaction/daily_transaction_view.xml:11、 マイファイル構造:

(太字での一つは、私のファイル名です)

__init__.py

from import daily_transaction 

{ 
     '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 __manifest__.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

<?xml version="1.0" encoding="utf-8"?> 

<odoo> 
<data> 

<!-- Main Menu Related Info -->   
<menuitem name="Daily Transaction" id="base.daily_transaction_root"   sequence="60"/> 
<!-- Sub Menu Related Info -->  
<menuitem id="menu_daily_transaction_root" name="Daily Transaction"   parent="base.daily_transaction_root" sequence="1" /> 
<!-- Action Menu Related Info -->  
<menuitem action="action_daily_transaction" id="menu_action_daily_transaction" parent="menu_daily_transaction_root" sequence="20"/> 

<!--Daily Transaction List View-->  
<record id="view_daily_transaction_tree" model="ir.ui.view"> <!-- here id is the external id for this tree view which must be unique and will be used for accessing this record --> 
<field name="name">daily.transaction.tree</field> <!-- this will be our name of record in ir.ui.view -->   
<field name="model">daily.transaction</field> <!-- this will map out tree view with our daily transaction model --> 
<field name="arch" type="xml">   
<!-- this will be our title of list/tree view -->    
<tree string="Daily Transaction">    
<!-- these will automatically map table headers for our list view, so we’ll select out column names of our model here -->    
<field name="name"/>    
<field name="date"/>    
<field name="type"/>    
<field name="amount"/>     
</tree>  
</field> 
</record> 


<!--Daily Transaction Form View-->  
<record id="view_daily_transaction_form" model="ir.ui.view">   
<field name="name">daily.transaction.form.view</field>   
<field name="model">daily.transaction</field>   
<field name="arch" type="xml">    
<!-- this will be our title of list/tree view -->    
<form string="Daily Transaction" version="7.0">     
<group>      
<field name="name"/>      
<field name="date"/>      
<field name="type"/>      
<field name="amount"/>      
<field name="note"/>         
</group>    
</form>   
</field>  
</record> 

<record id="action_daily_transaction" model="ir.actions.act_window">   
<field name="name">Daily Transaction</field>  <!-- name of action --> 
<field name="res_model">daily.transaction</field>  <!-- this action will be mapped to model specified --> 
<field name="view_type">form</field>   
<field name="view_mode">tree,form</field>  <!-- these are type of view our module will show for our daily transaction mode --> 
<field name="search_view_id" eval="False"/>  <!-- here we specify id of our search view --> 
<field name="context">{}</field>   
<field name="help">Create new daily transaction.</field> <!-- help text for our model --> 
</record> 

</data> 
</odoo 

>

答えて

2

アクションを使用しているため、それが作成される前に、それはこのエラーを与えているので、最初にあなたの行動を定義する必要があり、その後、あなたはそれを使用することができます。

<record id="action_daily_transaction" model="ir.actions.act_window">   
    <field name="name">Daily Transaction</field>  <!-- name of action --> 
    <field name="res_model">daily.transaction</field>  <!-- this action will be mapped to model specified --> 
    <field name="view_type">form</field>   
    <field name="view_mode">tree,form</field>  <!-- these are type of view our module will show for our daily transaction mode --> 
    <field name="search_view_id" eval="False"/>  <!-- here we specify id of our search view --> 
    <field name="context">{}</field>   
    <field name="help">Create new daily transaction.</field> <!-- help text for our model --> 
</record> 

<menuitem action="action_daily_transaction" id="menu_action_daily_transaction" 
parent="menu_daily_transaction_root" sequence="20"/> 
+1

それはそのエラーを解決したのが、今では見られない モデルの誤差があります:

だから、次のように試してみてくださいdaily.transactionを –

関連する問題