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.


Add a Button in a New Module..

aci aisha
on 2/2/15, 4:00 AM 420 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

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

2 follower(s)


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