2017-04-26 3 views
0

나는 초보자이며 다음은 쉬운 예제를 찾기 위해 많이 찾았습니다.이 태그는 제가 작업중인 첫 번째 모듈입니다. 내가 찾은 모든 예는 조금 이해하기 어렵거나 내 필요에 반응하지 않습니다. Odoo 10 : 버튼에서 Open XML보기

내가 3 개 모델이 있습니다 제품 패키지 Product_package을 나는 제품보기에서 product_package를 만들 필요가

(내 프로젝트 dB 개념에 따라 종속 테이블로이 일을 계속해야합니다).

I의 의견 /있는 product.xml 페이지 시도 :

<record model="ir.ui.view" id="product_form_view"> 
     <field name="name">product.form</field> 
     <field name="model">tjara.product</field> 
     <field name="arch" type="xml"> 
      <form string="Produit Form"> 
       <head> 
        <button name="%(product_package_list_action2)d" type='action' string='Ajouter Emballage'/> 
       </head> 
       <sheet> 
        <group> 
         <field name="name"/> 
         <field name="add_date"/> 
        </group> 
        <notebook> 
         <page string="Description"> 
          <label for="description" string="Fiche du produit"/> 
          <field name="description"/> 
         </page> 
         <page string="Fournisseurs"> 
          <label for="provider_ids"/> 
          <field name="provider_ids"/> 
         </page> 
         <page string="Clients"> 
          <label for="client_ids"/> 
          <field name="client_ids"/> 
         </page> 
        </notebook> 

       </sheet> 
      </form> 
     </field> 
    </record> 

제가 첨가 동일한 페이지 :

<record model="ir.actions.act_window" id="product_package_list_action2"> 
     <field name="name">Emballages</field> 
     <field name="res_model">tjara.product_package</field> 
     <field name="view_type">form</field> 
     <field name="view_mode">tree,form</field> 
     <field name="view_id" ref="product_package_form_view"/> 
    </record> 

어느 한 해결책이 달성 하였는가?

답변

0

그래, 해결책을 찾았습니다.

: 나는이 코드를 가지고있는 PRODUCT_PRICE의 XML 페이지에서

<record model="ir.actions.act_window" id="product_package_list_action2"> 
     <field name="name">Emballages</field> 
     <field name="res_model">tjara.product_package</field> 
     <field name="view_type">form</field> 
     <field name="view_mode">tree,form</field> 
     <field name="view_id" ref="product_package_form_view"/> 
    </record> 

: 나는 다음을 삽입 같은 페이지에서

    <header> 
         <button name="%(product_package_list_action2)d" type='action' string='Ajouter Emballage'/> 
        </header> 

:

은 제품 XML 페이지에있는 버튼입니다
<record model="ir.ui.view" id="product_package_form_view"> 
     <field name="name">product_package.form</field> 
     <field name="model">tjara.product_package</field> 
     <field name="arch" type="xml"> 
      <form string="Emballage Form"> 
       <sheet> 
        <group> 
         <field name="product_id"/> 
         <field name="package_id"/> 
         <field name="price"/> 
        </group> 
        <notebook> 
         <page string="Description"> 
          <field name="description"/> 
         </page> 
        </notebook> 

       </sheet> 
      </form> 
     </field> 
    </record> 

그리고 매니페스트에서 제품 Xml 앞에 product_package를로드합니다. 이것은 전체 페이지 대신 팝업 창을 띄워도 내 문제를 해결합니다.