Odoo Help

1

Show different tree views in a One2many field Odoo9

By
Jorge
on 4/16/18, 9:18 AM 210 views

Hello everybody, I would like to know if is possible that a one2many field shows differents tree views depending the value of a field, something like this:


<field name="fechas_infraestructuras" context="{'default_actividades_propias': id, 'default_x_ubicacion_actividad': x_ubicacion_actividad}" string="Detalles">

<tree string="Fechas" default_order="x_fecha_inicio" attrs="{'invisible': [('x_ubicacion_actividad', '=', 'exterior')]}">

<field name="x_fecha_inicio"/>

<field name="x_fecha_fin"/>

<field name="x_hora_inicio"/>

<field name="x_hora_fin"/>

<field name="x_instalaciones_usadas"/>

<field name="x_requisitos"/>

<field name="state" invisible="1"/>

<field name="x_ubicacion_actividad"/>

</tree>

(Now another tree view but with different fields)

<tree string="Fechas" default_order="x_fecha_inicio" attrs="{'invisible': [('x_ubicacion_actividad', '=', 'interior')]}">

<field name="x_fecha_inicio"/>

<field name="x_fecha_fin"/>

<field name="x_hora_inicio"/>

<field name="x_hora_fin"/>

<field name="x_personal_iamz"/>

<field name="x_requisitos"/>

<field name="state" invisible="1"/>

<field name="x_ubicacion_actividad"/>

</tree>

</field>


" x_ubicacion_actividad " is a selection field with 2 values ('interior' and 'exterior'), then I want show one of the tree views when  x_ubicacion_actividad is 'interior' and the other one if  x_ubicacion_actividad is 'exterior'.


Is that possible? Thanks!!!

1

Emipro Technologies Pvt. Ltd..

--Emipro Technologies Pvt. Ltd..--
Emipro Technologies Pvt. Ltd.
http://www.emiprotechnologies.com
6939
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd..--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.

 

Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 

 

We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :

 

  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd..
On 4/16/18, 10:11 AM

You can achieve using one alternative solution.

You need to create 2 one2many fields and add domain in each field.

Ex:

field_1=fields.One2many('model','field_name',domain=[('x_ubicacion_actividad','=','interior')])

field_2=fields.One2many('model','field_name',domain=[('x_ubicacion_actividad','=','exterior')])

After that add both field in the view and create inline tree view also visible field based on attrs.

Thank you so much!! It's a great idea!

Jorge
on 4/16/18, 10:16 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/16/18, 9:18 AM
Seen: 210 times
Last updated: 4/16/18, 10:16 AM