2014-02-18 1 views
0

재고 이동 트리에 범주를 표시하려면 어떻게해야합니까? 이것은 내 코딩입니다.상품 재고 상품 목록보기 openerp7의 나무를 이동

내보기 파일. 어떤 도움에 감사드립니다

class custom_stock_move_tree(osv.osv_memory): 
_columns = {  
      'categ_id': fields.related('product_id', 'categ_id', type='many2one' ,relation='product.category', store=True),    
      } 
custom_stock_move_tree() 

<record id="royalfood_stock_move_tree_view" model="ir.ui.view"> 
    <field name="name">stock.move.tree</field> 
    <field name="model">stock.move</field> 
    <field name="inherit_id" ref="stock.view_move_tree" /> 
    <field name="arch" type="xml"> 
       <xpath expr="//field[@name='product_id']" position="before"> 
      <field name="categ_id" groups="base.group_user"/> 
       </xpath> 
    </field> 
</record> 

내 평 파일.

답변

0

이 파일을 사용해보세요.

당신의 파일

class custom_stock_move_tree(osv.Model): #their is different b/w osv.Model and osv.osv_memory before to use it read it's usage 

    _inherit = 'stock.move' # if you want to add data in existing module use inherit 
    _columns = 
    {  
     'categ_id': fields.related('product_id', 'categ_id', type='many2one' ,relation='product.category', store=True, string='Product Category'),    
    } 

귀하의 view.xml이 당신의 주식 이동을 참조 트리보기 후 파일

<record id="royalfood_stock_move_tree_view" model="ir.ui.view"> 
<field name="name">stock.move.tree</field> 
<field name="model">stock.move</field> 
<field name="inherit_id" ref="stock.view_move_tree" /> 
<field name="arch" type="xml"> 
    <xpath expr="//field[@name='product_id']" position="before"> 
     <field name="categ_id" groups="base.group_user"/> 
    </xpath> 
</field> 

.

+0

답장을 보내 주셔서 감사합니다. –

+0

문제를 해결 했습니까 ?? –