Odoo Help

0

how to create own custom field in cutom modual

By
ramoliya nikunj
on 2/19/16, 3:39 AM 394 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
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
On 2/19/16, 4:10 AM

Refer Odoo Documentaion

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

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.

Register

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: 2/19/16, 3:39 AM
Seen: 394 times
Last updated: 2/19/16, 4:18 AM