Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
3117 Vistas
how to hide a stage "start" from kanban group in odoo 14? here is my xml code.

<record id="maintenance.hr_equipment_request_view_kanban" model="ir.ui.view">
<field name="name">equipment.request.kanbanfield>


<field name="model">maintenance.requestfield>
<field name="arch" type="xml">
<kanban default_group_by="stage_id" quick_create="false" sample="1" draggable="false" records_draggable="false" group_create="false"
group_delete="true" group_edit="true" archivable="true" class="o_kanban_mobile o_kanban_small_column o_kanban_project_tasks">
<field name="stage_id" readonly="1"/>
<field name="equipment_id"/>
<field name="user_id"/>
<field name="classification"/>
<field name="category"/>
<field name="trouble_category"/>

<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_dropdown_kanban dropdown">
<a role="button" class="dropdown-toggle o-no-caret btn" data-toggle="dropdown" data-display="static" href="#" aria-label="Dropdown menu" title="Dropdown menu">
<span class="fa fa-ellipsis-v"/>
a>
<div class="dropdown-menu" role="menu">
<t t-if="widget.editable"><a role="menuitem" type="edit" class="dropdown-item">Edit...a>t>
<t t-if="widget.deletable"><a role="menuitem" type="delete" class="dropdown-item">Deletea>t>
div>
div>
<div class="oe_kanban_content" >
<div class="o_kanban_record_top mb16">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title"><span><t t-esc="record.trouble_category.value"/>span>strong>
div>
div>
<div class="o_kanban_record_body">
<span name="user_id" t-if="record.user_id.raw_value">Diminta oleh : <field name="user_id"/><br/>span>
<span class="oe_grey" t-if="record.equipment_id.raw_value"><field name="equipment_id"/><br/>span>

div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<field name="name" />
div>
<div class="oe_kanban_bottom_right">
<field name="user_id" widget="many2one_avatar_user"/>
div>
div>
div>
<div class="oe_clear">div>
div>
t>
templates>
kanban>
field>
record>
Avatar
Descartar

You find a solution for this? I need the same but I can't find a solution

Mejor respuesta

To hide a stage named "start" from a Kanban group in Odoo 14, you can add a domain filter to the Kanban view for that group. Here is an example XML code that shows how to achieve this:

xml

In this example, the domain filter is added to the element of the Kanban view, using the domain attribute. The domain filter [('stage', '!=', 'start')] will hide the stage named "start" from the Kanban group.

Note that you need to replace my.model with the name of the model that you are creating the Kanban view for, and adjust the fields and templates to match your requirements. Also, make sure to include the templates section in your Kanban view, which defines the HTML templates used to display the records in the Kanban view.

Avatar
Descartar
Autor Mejor respuesta

thanks for answering,
and I have tried but failed, the error is like this

Error while validating view: 

Unknown field "maintenance.stage.stage_id" in domain of "[('stage_id', '!=', 'start')]" 

View name: equipment.request.kanban 

Error context: view: ir.ui.view(1755,) xmlid: maintenance.hr_equipment_request_view_kanban view.model: maintenance.request


my code:



 


Avatar
Descartar

You find a solution for this? I need to achieve the same but not find any working solution

Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 25
2508
2
jul 25
7947
2
jul 25
4386
2
jul 25
4097
2
jun 25
2691