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

Search for a name "starting with"...

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
searching
3 Odpowiedzi
20383 Widoki
Awatar
Antoine Morit

When you use a search, for example in the partner view, you get all names containing the word searched.

example for a search "te" :

ABC Company Limited, Tested One, View Technologies,  etc...

Is there a way to get only the names starting with the word searched ?

For the same example, for a search "te", we will only get :

Tested One

Thanks for help

0
Awatar
Odrzuć
Leonardo Donelli

Bogus answer. i accidentally clicked on "Convert to answer" on a comment (that wasn't even mine!) and I can't find a way to delete this answer.

Antonio M. Vigliotti

In search box, click on little down arrow and open full search menu. Select advanced search, choice name beginnig with Antonio Maria Vigliotti

Antonio M. Vigliotti

Sorry, Leonardo is right. There is no option "beginning with" in advanced search

Awatar
René Schuster
Najlepsza odpowiedź

Let's stick to your example: res.partner view

The search view has this field:

<field name="name" filter_domain="['|','|',('name','ilike',self),('parent_id','ilike',self),('ref','=',self)]"></field>

Let's focus on the first search tuple: ('name','ilike',self)

That filters all partners, that has the entered search name as part of the their name. (Note that ilike operator is case-insensitive (ilike is postgresql specific), while like is case-sensitive). SQL: name ILIKE '%self%'

What you want to perform is the query: name ILIKE 'self%'.

The like and ilike operators in OpenERP automatically add the wildcards arround the search term. To avoid that, you should use =like and =ilike operators. You then need to add the wildcard manually (otherwise it will search for the exact term), so I would guess you should change the search tuple to:

(name,'=ilike',self+'%')

I'm not sure you can add strings this way, but give it a try. Also change the other search tuples accordingly.

 

EDIT (since the reactions on this answer are wrongly brisk):

I've tested the mentioned search domain (name,'=ilike',self+'%') and it doesn't work.

What did work was (name,'=ilike',self) and searching for 'te%'. But that's not very userfriendly.

So the derived question from the OPs question is: How to automatically add the wildcard to the search term?

 

Best regards.

4
Awatar
Odrzuć
Awatar
Ivan Elizaryev
Najlepsza odpowiedź

I have tested René Schuster's solution on latest version openerp and it works:

<field name="name" filter_domain="['|','|',('name','=ilike',self+'%'),('parent_id','=ilike',self+'%'),('ref','=',self)]"></field>

it sends correct request ang get correct result

POST DATA:

{"jsonrpc":"2.0","method":"call","params":{"model":"res.partner","fields":["sale_order_count","title","parent_id","street","country_id","email","street2","state_id","display_name","zip","color","city","opportunity_count","function","phone","has_image","is_company","meeting_count","mobile","category_id","__last_update"],"domain":["|","|",["name","=ilike","a%"],["parent_id","=ilike","a%"],["ref","=","a"]],"context":{"lang":"ru_RU","tz":"Asia/Yekaterinburg","uid":1},"offset":0,"limit":40,"sort":""},"id":903990513}

It returns only contacts starting with "a".

So, the solution is to modify base.view_res_partner_filter view with filter_domain above

2
Awatar
Odrzuć
Awatar
Serpent Consulting Services Pvt. Ltd.
Najlepsza odpowiedź

Hi,

You can use '=like' or '=ilike' operator in domain for starting with comparision.

This is since v5, glad to share I worked for expression.py.

Thanks.

1
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ść
Add Search More when less items?
searching
Awatar
Awatar
Awatar
Awatar
3
maj 24
3027
odoo 8 search condition using date error
searching
Awatar
Awatar
2
gru 19
2175
how to search for a given list of several products?
searching productid
Awatar
Awatar
1
mar 24
2045
Use AND operator in search view Rozwiązane
searching searchbar
Awatar
Awatar
Awatar
Awatar
5
mar 22
16139
How to search from the notes (not internal notes) of a lead?
notes searching
Awatar
Awatar
2
maj 20
4881
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