Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Error: NameError: name 'search_default_filter' is not defined

Subscribe

Get notified when there's activity on this post

This question has been flagged
filtererrornameodoo12
1 Reply
5784 Views
Avatar
Marco

Hi
I'm facing issue trying to remove dependencies to filter 'type_student' in a module inherited from res.partner.
My goal is to delete this error and to correctly add 'type_student' as default filter to other views.
Even if I delete every call of type_student the error still be there.
Can anyone help me?
Thanks in advice. Here is the code of my res_partner module that inherit from res.partner.

<!-- PARTNER -->
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">

<xpath expr="//form" position="inside">

<header>

<button name="course_withdraw" type="object" string="Withdraw" states="active" class="oe_highlight"/>
<button name="course_rejoin" type="object" string="Rejoin" states="withdrawed" class="oe_highlight"/>

<field name="state" widget="statusbar"/>
</header>
</xpath>


<xpath expr="//field[@name='category_id']" position="after">
<field name="lesson_id"/>
</xpath>

<xpath expr="//page[@name='internal_notes']" position="before">

<page string="Gest Call">
<group>
<field name="is_student"/>
<field name="is_teacher"/>
<field name="is_operator"/>
<field name="topics" position="attribute" attrs="{'invisible':[('is_teacher','=',False)]}"/>
</group>
<group>
<field name="plan_ids">
<tree string="Plan">
<field name="title" />
<field name="plan_code" />
<field name="total_lesson_hours" />
</tree>
</field>
</group>
</page>

</xpath>
</field>
</record>


<!-- Contact search for gestcalls -->
<record id="view_search_gestcall_contact_form" model="ir.ui.view">
<field name="name">res.partner.search.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">

<field name="lesson_id"/>
<field name="projects_ids"/>
<field name="gest_course_id"/>
<field name="plan_ids"/>
<field name="topics"/>
<field name="participation_hour"/>
<field name="tot_inserted_hours"/>
<field name="state"/>
<field name="is_student" />
<field name="is_teacher" />
<field name="is_operator" />
</xpath>
<xpath expr="//separator" position="after">
<filter string="Companies" name="type_company" domain="[('is_company','=', True)]"/>
<filter string="Operators" name="type_operator" domain="[('is_operator', '=', True)]"/>
<filter string="Teachers" name="type_teacher" domain="[('is_teacher', '=', True)]"/>
<filter string="Students" name="type_student" domain="[('is_student', '=', True)]"/>

<group expand="0" string="Group By">
<filter name="is_student" string="Students" domain="[('is_student','=',True)]" context="{'group_by' : 'state'}"/>
<filter name="is_teacher" string="Teachers" domain="[('is_teacher','=',True)]" context="{'group_by' : 'lesson_id'}"/>
<filter name="is_operator" string="Operator" domain="[('is_operator','=',True)]" context="{'group_by' : 'projects_ids'}"/>
</group>
</xpath>

</field>
</record>

<!-- Contact actions for gestcalls -->
<record id="gestcall_contact_action" model="ir.actions.act_window">
<field name="name">Contact</field>
<field name="res_model">res.partner</field>
<!-- <field name="type">ir.actions.act_window</field>-->
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>

<field name="search_view_id" ref="view_search_gestcall_contact_form"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Add Contact
</p>
</field>
</record>


<record id="gestcall_kanban_contact_action_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="1" />
<field name="view_mode">kanban</field>
<field name="view_id" ref="base.res_partner_kanban_view" />
<field name="act_window_id" ref="gestcall_contact_action" />
</record>
<record id="gestcall_kanban_contact_action_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="2" />
<field name="view_mode">tree</field>
<field name="view_id" ref="base.view_partner_tree" />
<!-- <field name="context">{search_default_type_company:1}</field>-->
<field name="act_window_id" ref="gestcall_contact_action" />
</record>
<record id="gestcall_kanban_contact_action_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3" />
<field name="view_mode">form</field>
<field name="view_id" ref="base.view_partner_form" />
<field name="act_window_id" ref="gestcall_contact_action" />
</record>

here is the error

Error: NameError: name 'search_default_type_student' is not defined
http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:145
Traceback:
PY_ensurepy@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:145:65
py.evaluate@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:261:8
py.evaluate@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:270:156
py.eval@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:274:284
eval_contexts/<@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:410:110
iterator@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:14:183
createReduce/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:17:8
_.mixin/</_.prototype[name]@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:69:526
eval_contexts@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:408:136
eval_contexts/<@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:410:253
iterator@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:14:183
createReduce/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:17:8
_.mixin/</_.prototype[name]@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:69:526
eval_contexts@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:408:136
pyeval@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:427:8
_preprocessAction@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:483:439
_preprocessAction@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:507:127
OdooClass.extend/Class.include/</prototype[name]</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:3541:371
doAction/<@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:458:130
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:681
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
add@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:797:471
then/</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:649
each@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:625:767
then/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:560
Deferred@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:803:194
then@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:525
doAction@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:458:33
do_action@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:558:1326
_openMenu@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:568:1324
on_menu_clicked/</<@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:568:1050
exec/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:3751:384
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:681
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
add@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:797:471
then/</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:649
each@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:625:767
then/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:560
Deferred@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:803:194
then@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:525
exec@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:3751:354
on_menu_clicked/<@http://0.0.0.0:8099/web/content/392-1a081a9/web.assets_backend.js:568:995
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:681
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
fireWith@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:801:202
Deferred/</deferred[tuple[0]]@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:803:56
add/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:3750:831
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
fireWith@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:801:202
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:874
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
fireWith@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:801:202
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:874
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
fireWith@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:801:202
Deferred/</deferred[tuple[0]]@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:803:56
genericJsonRpc/<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:3558:10
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:681
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
fireWith@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:801:202
then/</</<@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:802:874
fire@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:796:299
fireWith@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:801:202
done@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:1192:95
callback@http://0.0.0.0:8099/web/content/327-b6c9587/web.assets_common.js:1212:23
0
Avatar
Discard
Avatar
Marco
Author Best Answer

I found the solution:

1. substitute

             <xpath expr="//separator" position="after">

with

            <xpath expr="/search/filter[1]" position="before">

2. replace

 <field name="context">{search_default_type_student:1}</field>

(even if you delete it remains in cahce and cause the error above)

with

<!--         Contact actions for gestcalls -->
<record id="gestcall_contact_action" model="ir.actions.act_window">
<field name="name">Contact</field>
<field name="res_model">res.partner</field>
<!-- <field name="type">ir.actions.act_window</field>-->
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
        <field name="context">{"search_default_type_student":1}</field>



0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
odoo 12 in ubuntu 18.04.4 Error ModuleNotFoundError: No module named 'werkzeug.contrib' Solved
error odoo12
Avatar
Avatar
Avatar
3
Sep 21
13272
Can not tabbing over readonly field in odoo 12. Help me please !!!
error bug odoo12
Avatar
0
Apr 24
2211
Search based on Many2many attachment file name
filter search odoo12
Avatar
0
Dec 21
2467
Problems migrating from odoo 12 to odoo 14 Solved
error odoo12 v14
Avatar
Avatar
2
Jan 21
6049
Filter domain in xml treeview, what is a logic behind it? Solved
filter treeview odoo12
Avatar
Avatar
2
Oct 20
5357
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now