콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5405 화면

In sales module under products menu i want to add a graph views in it by inheritance option. How to do it?

I am getting error: AssertionError: Element record failed to validate attributes.

Note: I am here to add the graph view in existing menu(sale order) only.


xml file


<record id="view_sale_order_graph" model="ir.ui.view">
 <field name="name">view.menu.sale.graph</field>
 <field name="model">sale.order</field>
 <field name="arch" type="xml">
     <graph string="Graphical View">
       ......
       ......
     </graph>
 </field>
 </record>

<!-- action -->

<record id="action_menu_sale_form" model="ir.actions.act_window">
 <field name="name">sales menu</field>
 <field name="res_model">sale.order</field>
 <field name="view_mode">graph</field>
 </record>


.py File

class custom_sales(osv.osv):
  _inherit = "sale.order"
custom_sales()
아바타
취소

Ram, graph view already exists for sale order. You want to inherit the existing graph view? or you want to add graph view to Products? Pls clarify your question

베스트 답변
You need refer the module before id before it can be inherited from old id. so can you try this way

<record id="sale.action_menu_sale_form" model="ir.actions.act_window">
 <field name="name">sales menu</field>
 <field name="res_model">sale.order</field>
 <field name="view_mode">graph</field>
 </record>

(OR)
<record id="action_menu_sale_form" model="ir.actions.act_window">
 <field name="name">sales menu</field>
 <field name="res_model">sale.order</field>
<field name="inherit_id" ref="sale.action_menu_sale_form"/>
 <field name="view_mode">graph</field>
 </record>
아바타
취소
관련 게시물 답글 화면 활동
1
11월 24
1882
5
7월 24
93671
1
12월 23
3241
1
5월 22
3944
0
1월 20
3106