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.

1

IOError: File not found openerp

By
omprakash
on 5/27/13, 4:05 AM 3,052 views

Hi Friends ,

I have doubt , what is problem in my custom module . Getting error as IOError : File not found . Please help to solve this problem .

This is my code :

  • __init__.py

    import sample

  • __openerp__.py

    { "name": "sample", "version": "7.0", "depends": ["base"], "author": "Prakash", "category": "Others", "description": """ This module provide : This module provide basic idea about creating custom module

    """, "init_xml": ["sample_view.xml"], 'update_xml': [""], 'demo_xml': [""], 'installable': True, 'active': False, }

  • sample.py

from osv import fields,osv

class sample(osv.osv): def _calculate(self, cr, uid, ids, fields, arg, context): x={} for record in self.browse(cr, uid, ids): x[record.id]= record.field_a + record.field_b return x _name = 'sample' _columns = { 'field_a' : fields.integer('field_a') , 'field_b' : fields.integer('field_b'), 'result' : fields.function(_calculate, type='integer', obj='sample', method=True, store=False, string='result'), } sample()

  • sample_view.xml

<openerp> <data> <record model="ir.ui.view" id="sample_tree_view"> <field name="name">sample.tree</field> <field name="model">sample</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree string="sample"> <field name="field_a"/> <field name="field_b"/> <field name="result"/> </tree> </field> </record>

    <record model="ir.ui.view" id="sample_form_view">
        <field name="name">sample.form</field>
        <field name="model">sample</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="sample">
                <field name="field_a"/>
                <field name="field_b"/>
                <field name="result"/>
            </form>
        </field>
    </record>

    <record model="ir.actions.act_window" id="action_sample_form">
        <field name="name">sample</field>
        <field name="res_model">sample</field>
    </record>

    <menuitem name="parent" icon="terp-project" id="parent_id"/>

<menuitem name="child" parent="parent_id" id="child_id" />

    <menuitem name="grandson" parent="child_id" id="grandson_id" action="action_sample_form"/>
</data>

</openerp>

When i try to install my module getting error in openerp-server.log:

2013-05-27 11:04:28,869 2372 INFO group openerp.modules.loading: module sample: loading objects 2013-05-27 11:04:28,903 2372 INFO group openerp.modules.module: module sample: creating or updating database tables 2013-05-27 11:04:29,482 2372 INFO group openerp.modules.loading: module sample: loading sample_view.xml 2013-05-27 11:04:29,651 2372 WARNING group openerp.addons.base.ir.ir_ui_view: Setting the type field is deprecated in the ir.ui.view model. 2013-05-27 11:04:29,736 2372 WARNING group openerp.addons.base.ir.ir_ui_view: Setting the type field is deprecated in the ir.ui.view model. 2013-05-27 11:04:29,923 2372 INFO group openerp.modules.loading: module sample: loading 2013-05-27 11:04:29,924 2372 ERROR group openerp.osv.osv: Uncaught exception Traceback (most recent call last): File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\osv\osv.py", line 123, in wrapper File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\osv\osv.py", line 179, in execute File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\osv\osv.py", line 166, in execute_cr File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server\openerp\addons\base\module\module.py", line 425, in button_immediate_install File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server\openerp\addons\base\module\module.py", line 476, in _button_immediate_function File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\pooler.py", line 39, in restart_pool File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\modules\registry.py", line 214, in new File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\modules\loading.py", line 347, in load_modules File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\modules\loading.py", line 258, in load_marked_modules File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\modules\loading.py", line 189, in load_module_graph File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\modules\loading.py", line 73, in <lambda> File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\modules\loading.py", line 111, in _load_data File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\tools\misc.py", line 172, in file_open File "C:\Program Files (x86)\OpenERP 7.0-20130118-002240\Server\server.\openerp\tools\misc.py", line 219, in _fileopen IOError: File not found: sample\

0
sridhar
On 5/27/13, 5:06 AM

Try this __openerp__.py code
{ "name": "sample", "version": "7.0", "depends": ["base"], "author": "Prakash", "category": "Others", "description": """ This module provide : This module provide basic idea about creating custom module

""",

'update_xml': ["sample_view.xml"], 
'demo_xml': [""], 
'installable': True, 
'active': False, 
}

https://accounts.openerp.com/forum/Help-1/question/17795#17839 see this link this is helpful for u ...

Hi Sridhar , Thanks for your immediate reply

omprakash
on 5/27/13, 1:13 PM
0

Maniganda

--Maniganda--
1038
| 5 7 7
Bangalore, India
--Maniganda--
Maniganda
On 5/27/13, 5:08 AM

Hi ,Prakash the problem might be with your xml file syntax can you give the xml here 'update_xml': ["sample_view.xml"]

Hi Maniganda , Thanks for your immediate reply

omprakash
on 5/27/13, 1:13 PM

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

1 follower(s)

Stats

Asked: 5/27/13, 4:05 AM
Seen: 3052 times
Last updated: 7/10/15, 3:25 AM