2017-04-10 16 views
0

これは数時間ですが、わかりません。私は作成したモジュールからフォームを印刷しようとしています。印刷ボタンをクリックすると、以下のエラーが表示されます。Odoo 9 ValueError:外部IDがシステムに見つかりません:

raise ValueError('External ID not found in the system: %s' % (xmlid)) 
ValueError: External ID not found in the system: ch08.qweb_ds_repair_template 

マイreport.xmlファイル

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

    <openerp> 
     <data> 

      <template id="qweb_ds_repair_template"> 
      <t t-call="report.html_container" > 
       <t t-foreach ="docs" t-as="o"> 
        <t t-call ="report.external_layout"> 
         <div class="page" > 
          <div class="oe_structure" /> 
          <h1>Repair Form</h1> 
          <h2>Test: <span t-field="o.password"/></h2> 
         </div> 
        </t> 
       </t> 
      </t> 
     </template> 

      <report id="report_ds_repair_template" 
        name="ch08.qweb_ds_repair_template" 
        model="ds.repair" 
        string="Repair Form" 
        report_type="qweb-pdf" 

        /> 

</data> 
    </openerp> 

マイモジュールフォルダがds_repairと呼ばれています。わからない私は私のopenerpの.pyで依存関係が欠落している場合ので、ここでは

{ 
    'name': 'Repairs', 
    'version': '1.0', 
    'sequence': 200, 
    'category': 'Manufacturing', 
    'summary': 'Repair', 
    'description': """, 
The aim is to have a complete module to manage all products repairs. 
==================================================================== 


""", 
    'depends': ['base'], 
    'website': '', 
    'data': ['report/report.xml', 
      'model_view.xml', 

      ], 
    'demo': [], 

    'installable': True, 
    'auto_install': False, 

} 

答えて

1

あなたが別のxml_idを参照したいときは、2つの可能性を持っている名= "ds_repair.qweb_ds_repair_template"

<report id="report_ds_repair_template" 
        name="ds_repair.qweb_ds_repair_template" 
        model="ds.repair" 
        string="Repair Form" 
        report_type="qweb-pdf" 

        /> 
0

わからない下回っているが、私はds_repairの代わりにch08が問題を引き起こしていると思います。 ドットの前のテキストは、名前空間またはアドオン(アドオンフォルダ)名のために予約されていることは間違いありません。

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

<openerp> 
    <data> 

     <report id="report_ds_repair_template" 
       name="ds_repair.qweb_ds_repair_template" 
       model="ds.repair" 
       string="Repair Form" 
       report_type="qweb-pdf"/> 

     <template id="qweb_ds_repair_template"> 
      <t t-call="report.html_container" > 
       <t t-foreach ="docs" t-as="o"> 
        <t t-call ="report.external_layout"> 
         <div class="page" > 
          <div class="oe_structure" /> 
          <h1>Repair Form</h1> 
          <h2>Test: <span t-field="o.password"/></h2> 
         </div> 
        </t> 
       </t> 
      </t> 
     </template> 

    </data> 
</openerp> 
0

を書く必要がありますので、あなたのモジュールのフォルダ名は "ds_repair" です。

あなたが書く:

<template inherited="module_name.xml_id"> 

この方法の一般的に使用されますが、別のモジュール

それとも、この場合

<template inherited="xml_id"> 

を缶にIDを参照したい場合、あなたがしたいですあなたのコードが書かれている現在のモジュールのidを参照してください。

あなたのエラーの起源があることができます:

  1. あなたがch08
  2. という名前のモジュールを持っていないあなたはch08という名前のモジュールを持っていますが、モジュール
  3. のid「qweb_ds_repair_template」を持っていません

しかし、あなたの現在の状況では、上記のIDの書き込みを参照したいと思います。

あなたは

<report id="report_ds_repair_template" 
     name="module_name.qweb_ds_repair_template" 
     model="ds.repair" 
     string="Repair Form" 
     report_type="qweb-pdf"/> 

PSを書くことができます:私は、モジュール名を言うとき、それはあなたのフォルダの名前です。

関連する問題