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

How to filter a view when cliking on a parent element ?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
projectfilterviewstaskodoo10
2 Odpowiedzi
8789 Widoki
Awatar
Evolutis Employee

Hi,

I can't understand the way when you click on a project (on the dashboard) the new view display only the tasks of this project. I want to do something similar. Can anyone help me, explaining the mechanism or linking some documentation ?

Thanks a lot.


0
Awatar
Odrzuć
Awatar
Laurent OLIVIER
Najlepsza odpowiedź

Hi,


The developper doc says you can use a type "action" in kanban box:

Buttons and fields
While most of the Kanban templates are standard QWeb, the Kanban view processes field, button and a elements specially:
    by default fields are replaced by their formatted value, unless they match specific kanban view widgets
    buttons and links with a type attribute become perform Odoo-related operations rather than their standard HTML function. Possible types are:
    action, object   standard behavior for Odoo buttons, most attributes relevant to standard Odoo buttons can be used.   ...


In the project_view.xml you find that the kanban project view is linked to an action called : act_project_project_2_project_task_all:

<div class="oe_kanban_project_list">

                                        <a t-if="record.use_tasks.raw_value" name="%(act_project_project_2_project_task_all)d" type="action" style="margin-right: 10px">                                           

                                        <t t-raw="record.task_count.raw_value"/> Tasks                                       

                                        </a>                                   

</div>


This action ( which is in the same module) filter the tasks of the active project :

<record id="act_project_project_2_project_task_all" model="ir.actions.act_window">

 <field name="name">Tasks</field>

 <field name="res_model">project.task</field>

 <field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>

 <field name="context">{

    'search_default_project_id': [active_id],

    'default_project_id': active_id,

    'active_test': False,

 }</field>

...

 

Edit :

To use  'search_default_project_id', you must have a search view where one filter named "project_id" exists.

See more explanations here :https://www.odoo.com/forum/help-1/question/set-default-filter-value-in-search-view-5856


If I'm not wrong, the key 'default_project_id': active_id means that, if you create a task, its project_id will be automatically set to active_id ( ie the project you clicked in kanban view).


1
Awatar
Odrzuć
Evolutis Employee
Autor

Hi, thanks a lot for this answer. Maybe my question wasn't precise enough. I saw this view, this action, and I manage do do something similar (displaying some element grouped like I wanted) but I don't understand from where the

" 'search_default_project_id': [active_id],

'default_project_id': active_id,"

syntax come. I tried to find a function that define it but I failed and I can't neither adapt it directly

(I tried :

<field name="context">{

'search_default_myclass_id': [active_id],

'default_myclass_id': active_id,

}</field>

)

Maybe I miss something ?

Laurent OLIVIER

see my edit

Evolutis Employee
Autor

Thanks it works !

I just have one more problem, maybe you can help me :

I have a system of class like this :

class GrandParent(models.Model):

[...]

class Parent(models.Model):

grand_dad_id=fields.Many2One('GrandParent')

children_ids=fields.One2Many('Child)

[...]

class Child(models.Model):

dad_id=fields.Many2One('Parent')

[...]

And when cliking on a grandParent kanban card I would like to display his "family" : his grand children (class child) grouped by parent

I don't know how to acess the "grand_dad" property.

I tried something like :

<record id="view_child_search" model="ir.ui.view">

[...]

<search string="User Stories">

<!-- <field name="dad_id.grand_dad_id"/> -->

[...]

</record>

With in the action on the grand_parent card :

{'search_default_parent':active_id}

Laurent OLIVIER

Maybe you could create a field or filter (in the search view) using a domain like [('parent_id','child_of',[self])] (or something like that) and using it in you search_default_xxx context key ? (but not sure it's exactly what you need!)

May I suggest to open a new thread with this question ?

Evolutis Employee
Autor

Ok I'll do that

Thanks a lot for your help !

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ść
How to "lock" task at a certain stage. Rozwiązane
project stages task odoo10
Awatar
Awatar
2
paź 24
6752
Problem with domain on view. How to filter this?
filter views domain odoo10
Awatar
Awatar
Awatar
6
gru 17
9727
[project module] Why "duplicate" action creates directly a new task (new instance)?
project task copy odoo odoo10
Awatar
0
kwi 20
3487
Different Task View in Projects App - Setting Multiple Views to one Model - Assigning Multiple Actions to one Model Rozwiązane
project views xml task window_action
Awatar
Awatar
Awatar
2
sie 19
4444
In project managment, where is the code that adds user to followers? Rozwiązane
project follower mail task odoo10
Awatar
Awatar
1
lip 19
3988
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