Odoo Help


Add a Button in a New Module..

aci aisha
on 2/2/15, 4:00 AM 731 views


I have to addd a new button named "Create File" in the header of task view(project.view_task_form2).

So i created a new module named project_task_file

And add files such as create_file.xml,creat_file.py..

then how will be my  create_file.xm..i coded it as follows

<?xml version="1.0" encoding="utf-8"?>
    <record model="ir.ui.view" id="create_file_number">
        <field name="name">project.task.file</field>
        <field name="model">project.task.file</field>
        <field name="inherit_id" ref="project.view_task_form2" />
        <field name="arch" type="xml">
           <xpath expr="/form/head >
                        <button name="create_file_number" string="Create File Number" type="object" class="oe_highlight"/>

 but error occured...as,


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>500 Internal Server Error</title> <h1>Internal Server Error</h1> <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>...

any1 can help...

N:B:MY .py file is as follows,

from openerp.osv import fields, osv

class project_task_file(osv.osv):
    _name = 'project.task.file'

    _inherit = ["project.task","file.details"]

    _columns = {
                'file_no':fields.char('File Number'),

    _defaults ={
    def create_file_number(self, cr, uid, ids, context=None):
        mod_obj = self.pool.get('ir.model.data')

        res = mod_obj.get_object_reference(cr, uid, 'file_details', 'view_file_details_form')

        res_id = res and res[1] or False


                    'name':'Create a File',


                    'type': 'ir.actions.act_window',

                    'view_type': 'form',

                    'view_mode': 'form',

                    'view_id': [res_id],





XmlHttpRequestError INTERNAL SERVER ERROR is just saying that the back-end server is not running for some reason. You need to share the log, if any, of the OpenERP server for analisis.

on 2/2/15, 4:14 AM

Hello Ivan... U r Great...!! Where r u from?

aci aisha
on 2/2/15, 8:34 AM

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

Question tools

2 follower(s)


Asked: 2/2/15, 4:00 AM
Seen: 731 times
Last updated: 3/16/15, 8:10 AM