Hide lines on tree view - openerp 7

2024/11/15 17:55:56

I want to hide all lines (not only there cointaner) in sequence tree view (the default view). I must hide all lines if code != 'foo' but the attrs atribute don't work on tree views, so how can i filter/hide this?

I don't have any code already, because i'm newbie in openerp and i dont know what to change.

The model is ir.sequence and is view (i think).

Answer

Attrs is to be used to hide columns / fields conditionally but not therecord, to hide records domain must be used.

If there is default tree view and you want to hide records from there then you must pass domain with action. And suppose there is one2many field and into that you want to hide records then you must set domain directly to that field.

You can use domain in following manner for one2many fields.

<field name="one2many_field_name" domain="[('relational_model_field','operator','value')]"><tree><field name="field1" /><field name="field2" /><field name="field3" /></tree>
</field>

And to set domain for default tree view, use domain with action.

<record id="action_id" model="ir.actions.act_window"><field name="name">Action Name</field><field name="res_model">model</field><field name="view_type">form</field><field name="domain">[('field','operator','value')]</field><field name="view_mode">tree,form</field>
</record>
https://en.xdnf.cn/q/119386.html

Related Q&A

Python Append dataframe generated in nested loops

My program has two for loops. I generate a df in each looping. I want to append this result. For each iteration of inner loop, 1 row and 24 columns data is generated. For each iteration of outer loop, …

bError could not find or load main class caused by java.lang.classnotfoundation error

I am trying to read the executable jar file using python. That jar file doesnt have any java files. It contains only class and JSON files. So what I tried is from subprocess import Popen,PIPEjar_locati…

Invalid value after matching string using regex [duplicate]

This question already has answers here:Incrementing a number at the end of string(2 answers)Closed 3 years ago.I am trying to match strings with an addition of 1 at the end of it and my code gives me t…

How to fetch specific data from same class div using Beautifulsoup

I have a link : https://www.cagematch.net/?id=2&nr=448&gimmick=Adam+Pearce In this link there data in divs with same class name. But I want to fetch specifi div. Like I want to fetch current g…

Python Matplotlib Box plot

This is my dataframe:{Parameter: {0: A, 1: A, 2: A, 3: A, 4: A, 5: A, 6: A, 7: A},Site: {0: S1,1: S2,2: S1,3: S2,4: S1,5: S2,6: S1,7: S2},Value: {0: 2.3399999999999999,1: 2.6699999999999999,2: 2.560000…

How to send turtle to random position?

I have been trying to use goto() to send turtles to a random position but I get an error when running the program.I am lost on how else to do this and not sure of other ways. My current code is:t1.shap…

How to scrape all p-tag and its corresponding h2-tag with selenium?

I want to get title and content of article: example web :https://facts.net/best-survival-movies/ I want to append all p in h2[tcontent-title]and the result expected is: title=[title1, title2, title3]co…

Tkinter: Window not showing image

I am new to GUI programming and recently started working with tKinter.My problem is that the program wont show my image, Im suspecing that it is my code that is wrong, however, I would like somone to e…

print dictionary minus two elements

Python 3.6All debug output is from PyCharm 2017.1.2I have a program that gets to this portion of the code:if len(errdict) == 21:for k, v in errdict.items():if k == packets output or bytes:continueprint…

Write CSV file using Python with the help of a csv dictionary / nested csv dictionary

I am having a csv file and i want to write it to another csv file. Its a bit complicated than it seems. Hoping someone to correct my code and rewrite it, so that i can get the desired csvfile. I am usi…