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

Domain on selection field

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
domainodoo8
1 Odpowiedz
16606 Widoki
Awatar
José

Hello, I am using Odoo8 and I want to define a domain in a many2many field, for a selection field. Specifically, the field is 'type' of model 'account.voucher'. I try ('type', '=', 'purchase') but not works; also I try ('type', 'like', 'purchase') but not works.

Is there a way to do this domain? Thanks!
 

0
Awatar
Odrzuć
Ivan

From your description alone, it should work. Providing if you set the domain as [('type', '=', 'purchase')] or [('type', 'like', 'purchase')], i.e. don't forget to put the tuple in a list. So, if it does not work, you need to provide a greater detail on how you apply the domain, in a view? From fields definition? From Record Rules?

José
Autor

My domain is in the field definition. This is my code: pays = fields.Many2many('account.voucher', domain=[('es_acopio', '=', True), ('type', '=', 'purchase')])

José
Autor

Using this domain, I can't see any 'account.voucher' (of course I have various account.voucher of type purchase). If I quit ('type', '=', 'purchase'), I can see the records.

Ivan

Your domain is a combination of 2 rules, and it is operating with and AND operator (the default). Maybe it is because you don't have data that satisfy both?

José
Autor

I have various records that satisfy both rules. Is this real: https://www.odoo.com/forum/help-1/question/domain-in-hardcoded-selection-field-21767 ?

Ivan

It is correct that selection fields cannot have it's selections be filtered by domain. But what you are trying to achieve is to domain account.voucher using a selection field, which is different. I'm running out ideas. If you really have records that satisfy both rules (SELECT * FROM account_voucher WHERE type = 'purchase' AND es_acopio = TRUE returns record that belongs to the company the user is currently logged in), I can't think of any other reasons. Try to increase your level of debugging to debug_sql and see that SQL command that is issued.

José
Autor

How can I see the SQL command and the result of this?

Ivan

To see the SQL command you need to set the log_level (either from the command line [--log-level] or configuration file [log_level], to 'debug_sql').

Awatar
Qutechs, Ahmed M.Elmubarak
Najlepsza odpowiedź

Hello,
Actually it is working fine ...

first define your many2many field with the domain just like:

_columns = {
        'voucher_ids': fields.many2many('account.voucher','voucher_test_rel','test_id', 'voucher_id','Voucher',domain="[('type','=','purchase')]"),
    }

then to be sure create a new voucher with type(Default Type) purchase from  Accounting->Journal Entries->Journal Vouchers

also you can test it from postgresql ..
loggin as postgres: sudo su postgres
then enter sql mode : psql
then connect to your database name : \c db_name
then query your account_voucher: select type from account_voucher;

I hope this could help

-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ść
Domain in many2many relation
domain odoo8
Awatar
Awatar
1
lut 16
4126
naked domain set up Rozwiązane
domain
Awatar
Awatar
Awatar
Awatar
3
lip 25
5941
Domain name Request
domain
Awatar
0
maj 25
1600
Domain is not working
domain
Awatar
Awatar
2
mar 24
2882
Domain depending on a field in odoo v8
domain
Awatar
0
sty 23
2426
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