Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
7130 Weergaven

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
Avatar
Annuleer
Beste antwoord

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
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 20
3394
12
dec. 18
34700
1
jul. 16
7019
2
mrt. 15
5894
1
mrt. 15
3660