This question has been flagged
27 Replies
21583 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.

Avatar
Discard

I think you didn't specify the entire path of your file

Author Best Answer
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).
Avatar
Discard

Where is updated code...

Author

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

Best Answer

The problem is here:

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

 just specify the empty brackets:

 'update_xml': [],
'demo_xml': [],
Avatar
Discard
Best Answer

{
'name':'Todo application',
'description':'ce module permet de gerer vos différentes taches.',
'author':'SORO',
'depends':['mail'],
'application':True,
'data':[

'todo_view.xml'
'security/todo_access_rules.xml'
'security/ir.model.access.csv'

]

}


Avatar
Discard
Best Answer

I solved this issue by:

1 - deleting all .pyc file in the folder

2 - restart postrgresql service

3 - restart openerp service

4 - upgrade module in Odoo interface

I' can't explain why it works, but... It works...

Avatar
Discard
Best Answer

check your File permission using chmod 777 -R file_name

Avatar
Discard
Best Answer
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.
Avatar
Discard
Author

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

update this __openerp__.py code

Author

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

Author

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

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

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,

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

Author

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

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

Author

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

Author

What was wrong in my files...?

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

put right mark for this question..

Author

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

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

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

Author

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

Author

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/