Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
projectfilterviewstaskodoo10
2 Respuestas
8785 Vistas
Avatar
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
Avatar
Descartar
Avatar
Laurent OLIVIER
Mejor respuesta

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
Avatar
Descartar
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 !

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
How to "lock" task at a certain stage. Resuelto
project stages task odoo10
Avatar
Avatar
2
oct 24
6748
Problem with domain on view. How to filter this?
filter views domain odoo10
Avatar
Avatar
Avatar
6
dic 17
9715
[project module] Why "duplicate" action creates directly a new task (new instance)?
project task copy odoo odoo10
Avatar
0
abr 20
3485
Different Task View in Projects App - Setting Multiple Views to one Model - Assigning Multiple Actions to one Model Resuelto
project views xml task window_action
Avatar
Avatar
Avatar
2
ago 19
4439
In project managment, where is the code that adds user to followers? Resuelto
project follower mail task odoo10
Avatar
Avatar
1
jul 19
3980
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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