Odoo Help

3 Answers

Kazim Mirza | Founder at TechUltra Solutions

--Kazim Mirza | Founder at TechUltra Solutions --
| 3 3 5
Ahmedabad, India
--Kazim Mirza | Founder at TechUltra Solutions --
Kazim Mirza | Founder at TechUltra Solutions
5/16/14, 12:57 AM

you can simply add field in _columns of your class

like this,

'name' : fields.many2one('res.partner','Employee')

you can use other res.partner field like this 

clement zotti
5/16/14, 11:05 AM

I solve my problem with the following information:

My python file is :
class my_module(osv.Model):
    _name = 'res.partner'
    _inherit = 'res.partner'
    _columns = {
            'pfield': fields.char('MyField', size=10)



my view xml is :

        <record id="my_module_view_tree" model="ir.ui.view">
            <field name="name">my.module.inherit.tree</field>
            <field name="model">res.partner</field>
            <field name="priority" eval="20"/>
            <field name="arch" type="xml">
                <tree string="Contacts List" create="false" delete="false">
                    <field name="name"/>
                    <field name="user_id" invisible="1"/>
                    <field name="country_id" invisible="1"/>
                    <field name="parent_id" invisible="1"/>
                    <field name="company_id" />
                    <field name="email"/>
                    <field name="pfield"/>

for select only the field i need to display


        <record id="action_contacts_view_tree" model='ir.actions.act_window.view'>
            <field name="sequence" eval="1"/>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="my_module_view_tree"/>
            <field name="act_window_id" ref="action_contact_list"/>

to display it when i click on my button

Ask a Question
Keep Informed
1 follower(s)
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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now