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

Hello,

I want to use crm.lead model's view crm.crm_case_form_view_oppor in my custome view. but when i change this view then it affect on original view.

How to do it. i don't know much about it. but i have tried. Can anyone help me.

- class that i have created:
class crm_lead(models.Model):
    _inherit = 'crm.lead'
    loanType_id = fields.Many2one('loan.type', "Type")
    duration = fields.Char("Durantion")

- view file
    <record model="ir.ui.view" id="crm_lead_inherited_form_view">
      <field name="name">Lead Form View</field>
      <field name="model">crm.lead</field>
      <field name="arch" type="xml">
        <form>
            <group>
                <field name="loanType_id" string="Loan Type" placeholder="Select loan type"/>
            </group>
        </form>
      </field>
    </record>

    <record model="ir.actions.act_window" id="action_for_lead_views">
      <field name="name">Leads</field>
      <field name="res_model">crm.lead</field>
      <field name="view_type">form</field>
      <field name="view_mode">kanban,tree,form</field>
      <field name="view_type">form</field>
      <field name="view_id" ref="crm_lead_inherited_form_view"/>
    </record>

    <menuitem 
        name="Loan Management" 
        id="root_menu" />

    <menuitem 
        name="Lead" 
        id="menu_lead" 
        action="action_for_lead_views" 
        parent="root_menu"
        sequence="1" />

actually i want crm.crm_case_form_view_oppor view in my custom view and remove some fields of it and add some custom fields. but i do this it affect on custom and base view also.
How to Solve??

Thanks in advance
아바타
취소
베스트 답변

Hi Haresh,

In your view file in the form view record you just missed the inherit_id 

<record model="ir.ui.view" id="crm_lead_inherited_form_view">
      <field name="name">Lead Form View</field>
      <field name="model">crm.lead</field>

      <field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
      <field name="arch" type="xml">
        <form>
            <group>
                <field name="loanType_id" string="Loan Type" placeholder="Select loan type"/>
            </group>
        </form>
      </field>
    </record>

By the above view I given in that inherit_id field is added so that only it should affect the oridinal view
아바타
취소
관련 게시물 답글 화면 활동
View inheritance 해결 완료
1
3월 20
3482
12
12월 18
34797
1
7월 16
7087
2
3월 15
5963
1
3월 15
3710