Odoo Help

0

how to show "incative" field in historical data?

By
ankita
on 12/5/14, 5:14 AM 928 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

1
Bole
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"
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

 

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: 12/5/14, 5:14 AM
Seen: 928 times
Last updated: 3/16/15, 8:10 AM