Odoo Help

0
0
Avatar

Kazim Mirza

--Kazim Mirza--
--Kazim Mirza--
Kazim Mirza
On 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 

0
0
clement zotti
On 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_module()

 

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"/>
                </tree>
            </field>
        </record>

for select only the field i need to display

and


        <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"/>
        </record>


to display it when i click on my button

About This Community

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

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