Odoo Help


This community 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.


how to show "incative" field in historical data?

on 12/5/14, 5:14 AM 548 views

I  make the two fields inactive in the Book master table by usiong "active" field.

Python code is -

class book_master(osv.osv):

 _name =""
    _order = "name asc"
    _columns = {
        'book_no' : fields.char('Book  ID', size=30, readonly=True),
        'name'             : fields.char('Procedure Type', size=60),
        'active': fields.boolean('Active', help="If unchecked, it will allow you to hide the Facility without removing it."),
    _defaults = {
         'active': 1,       

Xml code is

 <record id="view_book_master_form" model="ir.ui.view">
        <field name="name">book.master.form</field>
        <field name="model">book.master</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
         <form string="Book  Details">
          <field name="book_no"/>
          <field name="name"/>
          <field name="active"/>

I don't want to lose historical data associated with these books, just need them to not be visible in our book list.

Please help me




| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 12/5/14, 6:34 AM

Field named "active" has a special behavior... (in fact it is a 'reserved word')
if it is set True, is hides the record in tree views... this applies to any model...

If you don't want that type of behaivor just rename field active  to activ or something else, except "active"
f you have field named "active" to show those records in tree view, you need to set a custom filter on tree view,
and show fileds where active = False ... 

that should do the trick.. 

hope it helps


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 12/5/14, 5:14 AM
Seen: 548 times
Last updated: 3/16/15, 8:10 AM