Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

Error: NameError: name 'search_default_filter' is not defined

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
filtererrornameodoo12
1 Odpowiedz
5795 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Marco
Autor Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
odoo 12 in ubuntu 18.04.4 Error ModuleNotFoundError: No module named 'werkzeug.contrib' Rozwiązane
error odoo12
Awatar
Awatar
Awatar
3
wrz 21
13277
Can not tabbing over readonly field in odoo 12. Help me please !!!
error bug odoo12
Awatar
0
kwi 24
2217
Search based on Many2many attachment file name
filter search odoo12
Awatar
0
gru 21
2487
Problems migrating from odoo 12 to odoo 14 Rozwiązane
error odoo12 v14
Awatar
Awatar
2
sty 21
6053
Filter domain in xml treeview, what is a logic behind it? Rozwiązane
filter treeview odoo12
Awatar
Awatar
2
paź 20
5374
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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