Sylver
Sylver

Reputation: 39

adding new menuitem odoo 10 Sales addon doesn't work

I don't know what's missing here but the menuitem doesn't show in Odoo 10 I want to add a menuitem for showing a specific Customers called "Annonceur" here my field in python code

from odoo import models, fields, api
class Annonceur(models.Model):
    _inherit = 'res.partner'
    annonceur = fields.Boolean("annonceur", default=False)

then I want to add a menuitem in Left menu of Sale addon and window_action for showing this type of Customers axactly like Customers

<record id="action_partner_annonceur_form" model="ir.actions.act_window">
            <field name="name">Annonceurs</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">res.partner</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,kanban,form</field>
            <field name="domain">[('annonceur','=','True')]</field>
            <field name="context">{'default_customer':1, 'search_default_customer':1}</field>
            <field name="filter" eval="True"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to add a contact in your address book.
              </p><p>
                Odoo helps you easily track all activities related to
                a customer: discussions, history of business opportunities,
                documents, etc.
              </p>
            </field>
        </record>
        <menuitem id="annonceur_view" 
        parent="sales_team.menu_sales"
        name="Annonceurs"
        action="action_partner_annonceur_form"
        sequence="5"/>

that's all my code please help me what's missing here

Upvotes: 2

Views: 208

Answers (1)

Pablo Escobar
Pablo Escobar

Reputation: 685

Add inherit id in Action menu.

Add the code below in your action menu.

<field name="inherit_id" ref="base.view_res_partner_filter"/>

Upvotes: 1

Related Questions