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

Create custom filter for odoo 13 community[SOLVED]

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
salesfiltercommunity13
2 Odpowiedzi
3800 Widoki
Awatar
Learning_Odoo

Hi, I'm trying to create a custom filter to divide contacts into 3 categories:
1st is a client
2nd is a prospect
3° It is contact.

This is the code I am using.


is_client = fields.Boolean(compute='_customize_filter', string="Es un cliente")
is_prospect = fields.Boolean(compute='_customize_filter', string="Es un prospecto")
is_contact = fields.Boolean(compute='_customize_filter', string="Es un contacto")

def _customize_filter(self):
for
partner in self:
partner.is_prospect = True
partner.is_client = partner.total_invoiced > 0
partner.is_contact = bool(partner.parent_id)
if
partner.sale_order_count > 0:
if
partner.total_invoiced == 0 and not partner.is_client:
partner.is_prospect = True
else:
partner.is_prospect = False
else:
partner.is_prospect = False

In res.partner there are 3 fields (which are in a bar) called total_invoiced, sale_order_count and parent_id...
What I'm trying to do is the following...
If the contact has sales but no invoices made, the lead boolean will be activated.
2° If the contact has sales and has invoices, the boolean of he is a customer will be activated, but the boolean of is a prospect will be deactivated (because when he already has invoices made, he already becomes a customer).
3° If the contact has a sub-contact, the sub-contact will activate the boolean of that contact.


The condition works perfectly, but where the problem comes from is when doing the filtering.
This is my xml code (just try to do the client filter)

id="filter_register" model="ir.ui.view">
name="name">res.partner
name="model">res.partner
name="inherit_id" ref="base.view_res_partner_filter"/>
name="arch" type="xml">
expr="//search/separator" position="after">
domain="[('is_client','=',True)]" name="is_client" string="Es un cliente PRUEBA"/>



But the filter doesn't work like that...
If I set the store=True to the boolean fields it doesn't work either, since locally at the moment of reloading the page, the log gets stuck and no longer advances...
Is there a way that I can create this filter for the 3 boolean fields?
Or if there is a module that already activates the boolean fields automatically and allows me to make filters...
Since the modules I found do not have a condition in which the fields are automatically activated...
Thank you.

0
Awatar
Odrzuć
Awatar
Jainesh Shah(Aktiv Software)
Najlepsza odpowiedź

Hello Learning_Odoo,

Please find code in comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

1
Awatar
Odrzuć
Jainesh Shah(Aktiv Software)

lease find below code it may help you to resolve this issue,

<record id="inherit_view_res_partner_filter" model="ir.ui.view">
<field name="name">res.partner.select</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<xpath expr="//search//filter[@name='type_company']" position="after">
<filter name="is_client" string="Es un cliente PRUEBA" domain="[('is_client', '!=', False)]"/>
</xpath>
</field>
</record>

Awatar
Niyas Raphy (Walnut Software Solutions)
Najlepsza odpowiedź

Hi,

If you are making the field as stored fields, you should add proper dependencies to the compute function, so that the function will get recalculated when the dependencies get changed.  

So you have to check and see, whether proper dependencies can be added so that it can be made as storable field.

If it cannot be made as stored field, other option to define the search functions for the field. See:  Searchable Non Stored Compute Field In Odoo


Thanks

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ść
Dashboard Same period last year filter
sales filter
Awatar
Awatar
1
mar 25
1430
How to hide the producty internal reference on the printed invoice? (I did it on the SO!) Rozwiązane
sales community v11
Awatar
Awatar
Awatar
2
cze 25
10192
How can I know in which sales orders the forecasted products have been used in odoo 13 community
community odoo 13
Awatar
Awatar
2
lut 24
2145
How to exchange Product in Odoo V10C
sales community odoo10
Awatar
Awatar
1
paź 17
3802
Odoo times out when generating an invoice for 2,000 to 8,000 Sales Orders - ie: 40,000 invoice lines
sales community invoice V15
Awatar
Awatar
1
lip 25
2366
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