Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Add Custom Filter

Odoberať

Get notified when there's activity on this post

This question has been flagged
sale.ordercount
2 Replies
5497 Zobrazenia
Avatar
Mohamad Ali Chamas

I need to add custom filter for a field inside my list view (sale_order_count). How can I add it, I need to filter it like: sale_order_count greater than, less than, etc...

0
Avatar
Zrušiť
Cybrosys Techno Solutions Pvt.Ltd

Hi,
You can try refer the following blog
https://www.cybrosys.com/blog/how-to-add-filters-to-existing-search-view-in-odoo

Mohamad Ali Chamas
Autor

Hello, this blog is to add search filter but I need to add custom filter to search by

Avatar
Malay Khamar (Serpent Consulting Services Pvt. Ltd.)
Best Answer

Hi Moe,

Please upgrade the module after adding store=True in the field from py side and check.

custom filter conditions are based on the field type. So if you want to see the greater than and less than type of the conditions, then you need to define the fields type as Integer.

Hope it will help you.


2
Avatar
Zrušiť
Mohamad Ali Chamas
Autor

It worked, but after I made it as store=True the count of all sale order was reset to 0. Why is this problem?

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Hi Moe,
Thanks for giving vote for the answer.
Yes, Now your function will call once you change your function dependent fields and calculate the result . Integer field type has the default value 0.

Mohamad Ali Chamas
Autor

Can you give me a glimpse of the code please, I didn't get it so much. You are welcome Malay

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Yes sure Moe,
Please try with this

sale_order_count = fields.Integer(compute="_get_sale_order_count", string="Sale Order Count(s)", store=True)

def _get_sale_order_count(self):
for rec in self:
rec.sale_order_count = len(rec.sale_order_ids.ids)

where sale_order_ids is the field inside your model, or search all the sale order ids and add it instead of the len(rec.sale_order_ids.ids)

Please vote up the answer if it helps you.
Thanks

Avatar
Mehjabin Farsana
Best Answer

Hi Moe,

In order to add a custom field in filters ,  the field should be a stored field.

If your field sale_order_count is a computed field, you have to store that field using proper dependencies.

After that you can add that field in filters

Hope this will help you 

Thank You

0
Avatar
Zrušiť
Mohamad Ali Chamas
Autor

I made the field stored with python code but it is still not showing, any ideas please?

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

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Display field only for one company on list view Solved
sale.order
Avatar
Avatar
1
máj 25
1772
Sale order Balance
sale.order
Avatar
Avatar
Avatar
2
nov 24
2823
Mark a sales order as fully invoiced despite Order amount and invoiced amount do not match () Solved
sale.order
Avatar
Avatar
Avatar
Avatar
Avatar
4
feb 24
13461
sale / delivery Solved
sale.order
Avatar
Avatar
1
jan 24
2249
signature and stamp / sale order
sale.order
Avatar
0
máj 23
2478
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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