Odoo Help

Welcome!

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.

0

how to remove fields from inherit table ? [Closed]

By
priyankahdp
on 3/18/13, 6:04 AM 4,454 views

The Question has been closed

by
priyankahdp
on 04/20/2013 03:22:43

in my model class i inherit hr.employee model.but i not need some fields from that model.how to remove those fields.?

class madulsima_plucker(osv.osv):
    _name = "madulsima.plucker"
    _description = "This table is for keeping personal data of madulsima pluckers"
    _inherit = "hr.employee"
    _columns = {
        'reg_no': fields.char('Registration Number', size=256, required=True),
        'worker_name': fields.char('Worker Name', size=256, required=True)
    }

madulsima_plucker()


<?xml version="1.0"?>
<openerp>
    <data>
        <!-- 1st part of the sim_view start -->
        <record model="ir.ui.view" id="madulsima_plucker_form">
            <field name="name">madulsima.plucker.form</field>
            <field name="model">madulsima.plucker</field>
            <field name="inherit_id" ref="hr.view_employee_form" />
            <field name="type">form</field>
            <field name="arch" type="xml">
                <notebook position="inside">
                    <page string="Madulsima Plucker Fields">
                        <field name="reg_no" />
                        <field name="worker_name" />
                        <field name="ssnid" position="replace" />
                        <field name="sinid" position="replace" />
                    </page>
                </notebook>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_plucker_registration">
            <field name="name">Plucker Registration</field>
            <field name="res_model">madulsima.plucker</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
        </record>


        <menuitem id="menu_madulsima_plucker" name="Madulsima/Checkroll" />

        <menuitem id="menu_madulsima_plucker_registration" name="Plucker Registration"
            parent="menu_madulsima_plucker" action="action_plucker_registration" />
    </data>
</openerp>

and i also try with view.xml for remove those fields as per developer book.its not worked.where is my issue .?

2

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/18/13, 6:16 AM

Hi,

you have 2 possibilities example field ssnid in hr employee:

replace (not good for me) :

            <xpath expr="/form/notebook/page/group/field[@name='ssnid']" position="replace"> 
            </xpath>

field becomes just invisible :

            <xpath expr="/form/notebook/page/group/field[@name='ssnid']" position="attributes"> 
                <attribute name="invisible">True</attribute>
            </xpath>

Bye

thanks GEM.u helped me a lot :-)

priyankahdp
on 3/18/13, 6:25 AM

About This Community

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

Question tools

0 follower(s)

Stats

Asked: 3/18/13, 6:04 AM
Seen: 4454 times
Last updated: 3/16/15, 8:10 AM