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 create own custom field in cutom modual

By
ramoliya nikunj
on 2/19/16, 3:39 AM 207 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
1

Jignesh Mehta

--Jignesh Mehta--
2087
| 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"?>

<odoo> 

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

             <form>

                 <sheet>

                     <group>

                         <field name="name"/>

                     </group>

                 </sheet>

             </form>

         </field>

     </record>


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

             <tree>

                 <field name="name"/>

             </tree>

         </field>

     </record>


    <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>

    </record>


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


</odoo>



Hope it works for you.

Thanks,

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

Odoo
on 2/19/16, 6:24 AM

also add the menuitem tag first ,then add the parent

Odoo
on 2/19/16, 6:24 AM
-1

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 2/19/16, 4:10 AM

Refer Odoo Documentaion

https://www.odoo.com/documentation/8.0/

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)

Stats

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