Odoo Help


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.


how to create own custom field in cutom modual

ramoliya nikunj
on 2/19/16, 3:39 AM 187 views

how to create own custom field in cutom modual like this 'test' : fields.custom('string')

ramoliya nikunj
on 2/19/16, 6:46 AM

Jignesh Mehta

--Jignesh Mehta--
| 6 4 8
Surat, India
--Jignesh Mehta--

Jignesh Mehta
On 2/19/16, 4:18 AM

Hello Nikunj,

Py File:-

class custom_class(models.Model):

     _name = 'custom.class'

     name = fields.Char('Name')

XML file :-

<?xml version="1.0" encoding="utf-8"?>


     <record id="custom_class_form_view" model="ir.ui.view">

         <field name="name">custom.class.form.view</field>

        <field name="model">custom.class</field>

         <field name="arch" type="xml">




                         <field name="name"/>






    <record id="custom_class_tree_view" model="ir.ui.view">

         <field name="name">custom.class.treeview</field>

        <field name="model">custom.class</field>

         <field name="arch" type="xml">


                 <field name="name"/>




    <record id="action_custom_class" model="ir.actions.act_window">

        <field name="name">Custom Class</field>

        <field name="res_model">custom.class</field>

        <field name="view_type">form</field>

        <field name="view_mode">tree,form</field>


    <menuitem name="Custom Class" id="custom_class_menu" action="action_custom_class"/>


Hope it works for you.


No its not works add the parent tag also in the menuitem

on 2/19/16, 6:24 AM

also add the menuitem tag first ,then add the parent

on 2/19/16, 6:24 AM


| 5 2 5
kerala, India

Working as a Odoo Functional and Technical Expert

On 2/19/16, 4:10 AM

Refer Odoo Documentaion


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

1 follower(s)


Asked: 2/19/16, 3:39 AM
Seen: 187 times
Last updated: 2/19/16, 4:18 AM