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.

4

IOError: File not found

By
Atchuthan
on 5/22/13, 4:24 AM 4,484 views

I am getting this error: IOError: File not found

**Client Traceback**
2013-05-22 06:18:10,025 12660 ERROR sem openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/var/app/openerp/server/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/var/app/openerp/server/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/var/app/openerp/server/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/var/app/openerp/server/openerp/addons/base/module/module.py", line 424, in button_immediate_install
    return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
  File "/var/app/openerp/server/openerp/addons/base/module/module.py", line 475, in _button_immediate_function
    _, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/var/app/openerp/server/openerp/pooler.py", line 39, in restart_pool
    registry = RegistryManager.new(db_name, force_demo, status, update_module)
  File "/var/app/openerp/server/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/var/app/openerp/server/openerp/modules/loading.py", line 348, in load_modules
    processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
  File "/var/app/openerp/server/openerp/modules/loading.py", line 259, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/var/app/openerp/server/openerp/modules/loading.py", line 190, in load_module_graph
    load_update_xml(module_name, idref, mode)
  File "/var/app/openerp/server/openerp/modules/loading.py", line 74, in <lambda>
    load_update_xml = lambda *args: _load_data(cr, *args, kind='update_xml')
  File "/var/app/openerp/server/openerp/modules/loading.py", line 112, in _load_data
    fp = tools.file_open(pathname)
  File "/var/app/openerp/server/openerp/tools/misc.py", line 173, in file_open
    return _fileopen(name, mode=mode, basedir=rtp, pathinfo=pathinfo, basename=basename)
  File "/var/app/openerp/server/openerp/tools/misc.py", line 220, in _fileopen
    raise IOError('File not found: %s' % basename)
IOError: File not found: rest/

**__openerp__.py**
{
    "name": "rest",
    "version": "7.0",
    "depends": ["base"],
    "author": "author",
    "category": "category",
    "description": "This module provide : test",
    "init_xml": [],
    'update_xml': [""],
    'demo_xml': [""],
    "data" : ["rest_view.xml"],
    'installable': True,
    'active': False,
}

**rest.py**
from osv import fields,osv

class rest(osv.osv):
    _name = 'rest'
    _columns = {
            'test' : fields.char("test")
                    }
rest()

**rest_view.xml**
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
               <record model="ir.ui.view" id="rest_form_view">
                <field name="name">rest.form</field>
                <field name="model">rest</field>
                <field name="type">form</field>
                <field name="arch" type="xml">
                    <form string="form_rest">
                        <field name="test" select="1"/>
                    </form>
                </field>
            </record>


        <act_window name="rest_act"
            res_model="rest"
            src_model="rest"
            id="act_rest_id"/>
    <menuitem id="oone_id" name="oone" />
    <menuitem id="ttwo_id" name="ttwo" parent="oone_id" />
    <menuitem id="tthree_id" name="tthree" parent="ttwo_id" action="act_rest_id"/>
    </data>
</openerp>

This is my code for my custom module "rest". Point me the possibility for this error occurrence @ possible file.

1
Atchuthan
On 5/31/13, 7:52 AM
Hi guyz,
  This is my suggestion for my question: 
     Just delete the __openerp__.py file and retype the code again, also restart the openerp server. This worked for me whenever I got this problem.

     Technically, the error occurs @ action window (found by checking the code by eclipse debugger).

Where is updated code...

sridhar
on 5/31/13, 8:02 AM

<record model="ir.actions.act_window" id="action_rest_form"> <field name="name">rest</field> <field name="res_model">rest</field> </record>

Atchuthan
on 5/31/13, 8:19 AM
0
shiva
On 10/17/16, 8:04 AM

check your File permission using chmod 777 -R file_name

0

The problem is here:

    'update_xml': [""],
    'demo_xml': [""],

 just specify the empty brackets:

 'update_xml': [],
'demo_xml': [],
0
sridhar
On 5/22/13, 7:24 AM
Update this code:

    {
    'name': 'rest',
    'version': '1.0',
    'depends': ['base'],
    'author': 'author',
    'category': 'category',
    'description': """This module provide : test""",
    'update_xml': [],
    "data" : ['rest_view.xml'],
    'installable': True,
    'active': False,
}

rest_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
               <record model="ir.ui.view" id="rest_form_view">
                <field name="name">rest.form</field>
                <field name="model">rest</field>
                <field name="type">form</field>
                <field name="arch" type="xml">
                    <form string="form_rest">
                        <field name="name" select="1"/>
                    </form>
                </field>
            </record>

            <act_window 
                name="rest_act"
                res_model="rest"
                src_model="rest"
                id="act_rest_id"/>
    <menuitem id="oone_id" name="oone" />
    <menuitem id="ttwo_id" name="ttwo" parent="oone_id" />
    <menuitem id="tthree_id" name="tthree" parent="ttwo_id" action="act_rest_id"/>

        </data>
</openerp>

rest.py
from openerp.osv import fields, osv



class rest(osv.osv):
    _name = 'rest'
    _columns = {
        'name':fields.char('Test',size=64),
    }
rest()

update this code it should be work.

Hi Sridhar, I have changed the code according to what u have given, then also the same error is coming...

Atchuthan
on 5/22/13, 7:58 AM

update this __openerp__.py code

sridhar
on 5/22/13, 8:08 AM

after updating :

2013-05-22 10:41:01,162 12660 ERROR today openerp.osv.orm: Can't find field 'name' in the following view parts composing the view of object model 'rest': * rest.form

Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model 2013-05-22 10:41:01,197 12660 ERROR today openerp.addons.base.ir.ir_ui_view: Can't render view for model: rest

Atchuthan
on 5/22/13, 8:42 AM

When i tried your code before you modified your answer, I had the same error: IOError: File not found.

Atchuthan
on 5/22/13, 8:45 AM

send ur mail id i send it here it is working perfectly, or, uninstall the module and try it will work.

sridhar
on 5/22/13, 8:57 AM

in test_view.xml file go step by by step definitely it work. <openerp> <data> <record model="ir.ui.view" id="rest_form_view"> <field name="name">rest.form</field> <field name="model">rest</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="form_rest"> <field name="name" select="1"/> </form> </field> </record> </data> </openerp> till run it. then,

sridhar
on 5/22/13, 9:01 AM

<openerp> <data> <record model="ir.ui.view" id="rest_form_view"> <field name="name">rest.form</field> <field name="model">rest</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="form_rest"> <field name="name" select="1"/> </form> </field> </record>

    &lt;act_window 
        name="rest_act"
        res_model="rest"
        src_model="rest"
        id="act_rest_id"/&gt;

</data> </openerp> till run here, it will install here, then the final step add the full file your menu will come there.

sridhar
on 5/22/13, 9:03 AM

Now after editing,

TypeError: VARCHAR parameter should be an int, got <type 'set'> 2013-05-23 05:27:18,591 6144 ERROR zzz openerp.netsvc: VARCHAR parameter should be an int, got <type 'set'>

Atchuthan
on 5/23/13, 3:30 AM

u replace your code and put it my code it will work sure.

sridhar
on 5/23/13, 4:13 AM

I replaced to your code and its working fine, but there is no change in my code except change from "data" to "update_xml".

Atchuthan
on 5/24/13, 5:21 AM

What was wrong in my files...?

Atchuthan
on 5/24/13, 5:21 AM

__openerp__.py have some changes "" is changed to single ' ' , some indent error solved in rest.py file that it.

sridhar
on 5/24/13, 6:02 AM

put right mark for this question..

sridhar
on 5/24/13, 6:03 AM

We can use either " " or ' '. So what is the problem?

Atchuthan
on 5/27/13, 2:53 AM

"data" : ["rest_view.xml"], 'update_xml': [""], that is the main problem for this error, use ' single course that is better for coding.

sridhar
on 5/27/13, 5:00 AM

"data" : ["rest_view.xml"], 'update_xml': [""], its a syntax error that is the reason.

sridhar
on 5/27/13, 6:59 AM

see this link in openerp documentation : https://doc.openerp.com/trunk/server/03_module_dev_01/#manifest-file-openerp-py

they have given that... we can use data instead of init_xml and update_xml...

Atchuthan
on 5/27/13, 7:20 AM

i had made query regarding putting the view.xml file in init_xml and update_xml : http://help.openerp.com/question/17417/where-to-put-my-model_viewxml-in-initxml-or-updatexml/

Atchuthan
on 5/27/13, 7:23 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)

Stats

Asked: 5/22/13, 4:24 AM
Seen: 4484 times
Last updated: 10/17/16, 8:04 AM