This question has been flagged
1 Reply
3043 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"/>
         </form>
       </field>
       </record>

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

Thanks

Avatar
Discard
Best Answer

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"
or
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

 

Avatar
Discard