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.

0

import init file in open erp

By
bakhtawar
on 11/27/13, 2:14 AM 1,640 views

first i create a module in eclipse using addons-new-PyDevPackage then in allocation i got to file-peydev module then i create a _openerp_.py and i write this code

Created on Nov 27, 2013

{ 
'name' : "Allocation",
'version': "1.0",
'author': "abc",
'category': "Tools",
'depends' : ["asset"],
'data': [
       'allocation_view.xml',
        ],
        'demo':[
             'allocation_demo.xml
             ],
             'installable': True,
 }

@author: abc '''

then when i import this in init file like impoort Allocation it shows me error

Description Resource Path Location Type Unresolved import: Allocation __init__.py

how i import?

Post the server log and your __init__.py file.

Gopakumar N G
on 11/27/13, 2:18 AM

when i open _init_py.file and write import Allocation then it shows me error and server log means?

bakhtawar
on 11/27/13, 2:26 AM

pleae tell me i really need help about this :(

bakhtawar
on 11/27/13, 2:36 AM

Do you have a file named Allocation.py in your module? There is single quote (') missing in your __openerp__.py file's 'demo':[ 'allocation_demo.xml ], After allocation_demo.xml, correct it also.

Gopakumar N G
on 11/27/13, 4:47 AM

yes i have a file allocation.py but i havent code in it

bakhtawar
on 11/27/13, 4:53 AM

Ok. There is only one line in your __init__.py file and which is import allocation. Is "allocation.py" is name of your python file? In init file we import the python files we have created in our module.

Gopakumar N G
on 11/27/13, 5:34 AM

Your init file contains import allocation and the file name is allocation.py right? Are the spelling of file allocation is same in init.py? Also let me know the directory structure, is your module is in addons folder?

Gopakumar N G
on 11/27/13, 7:41 AM

yes spellin are correct and when i create modulue in the director of addons the modulue also their in addons folder

bakhtawar
on 11/27/13, 11:42 AM

Are you running the server on ubuntu? if yes then what is the error shown in the terminal?

Gopakumar N G
on 11/28/13, 1:43 AM

i am using windows 7

bakhtawar
on 11/28/13, 3:08 AM

Check the log file for the error description, the log file is in the server folder of your openerp installation. http://forum.openerp.com/forum/topic24127.html

Gopakumar N G
on 11/28/13, 3:26 AM

is it import Allocation or import allocation that you have written?

Pravitha
on 12/2/13, 7:59 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

0 follower(s)

Stats

Asked: 11/27/13, 2:14 AM
Seen: 1640 times
Last updated: 3/16/15, 8:10 AM