2016-12-06 6 views
0

製造モジュールの「ツリービュー」を編集しようとしていました。詳細を簡単に表示するために、このビューに「product_uom_qty」を追加しようとしています。私はxmlを編集しようとしましたが、モデルの一部ではないので、単に列を追加するだけです。しかし、それらはお互いに関連しています。ここでOdooのXML <model> .pyファイルで何をしても何も起こりません

はXMLファイルです:

<?xml version="1.0"?> 
<tree decoration-bf="message_needaction==True" decoration-info="state in ('draft','confirmed')" decoration-danger="date_planned&lt;current_date and state not in ('done','cancel')" decoration-muted="state in ('done','cancel')" string="Manufacturing Orders"> 
        <field name="message_needaction" invisible="1"/> 
        <field name="name"/> 
        <field name="date_planned"/> 
        <field name="product_id"/> 
        <field name="product_qty" sum="Total Qty"/> 
        <field name="product_uom" options="{'no_open':True,'no_create':True}" groups="product.group_uom"/> 
        <field name="routing_id" groups="mrp.group_mrp_routings"/> 
        <field name="hour_total" sum="Total Hours"/> 
        <field name="cycle_total" sum="Total Cycles"/> 
        <field name="origin"/> 
        <field name="state"/> 
       </tree> 

私はモデルの列が含まれていますが、残念ながら何も起こらなかったmrp.pyあるのPythonベースのファイルを編集してみました。ファイル内のすべてのコードを削除しようとしましたが、Manufacturingモジュールのページを更新しても何も変更されませんでした。

上記のコードの基本モデルは、 "stock.move"に関連する "mrp.production"です< - product_uom_qtyを含みます。

答えて

0

これはodooの有効なXMLではありません。<openerp> <data>というタグがあります。このファイルをモデルに入れて、ツリーを<record>タグに入れる必要があります。エラーが表示されない場合は、データで__openerp__.py:あなたは__openepr__.py

にこのファイルを追加する必要があります

<openerp> 
    <data> 
      <record id="tree_id" model="ir.ui.view"> 
       <field name="model">model.name.here</field> 
       <field name="priority" eval="0"/><!-- this tree will be the default tree for the model --> 
       <field name="arch" type="xml"> 
        <tree > 
         <field name="field_name"/> 
         <field name="field_name"/> 
        </tree> 
       </field> 
      </record> 
    </data> 
</openerp> 

と 'your_xml_file.xml'

関連する問題