This blog used for store a little of my knowledge.. yeah just to help me who's very easy to forget something... Hmm just as al little extra space of my brain... I hope this blog will also useful for others.. Then, I try with my best to write in English language... to improve my English literary... Forgive me if there are so much mistaken.. Gomen kudassai
Showing posts with label python. Show all posts
Showing posts with label python. Show all posts
Sunday, May 26, 2013
Monday, June 20, 2011
[openerp] ZipImportError: bad local file header in pathtozipfile.zip
Bismillahirrahmaanirrahiim...
Today I just learned how to create a simple module in openerp...
I read this sources:
- http://www.ibcscorp.com/application-integration-customization/erp/openerp-2/openerp-custom-module-development-quick-start-guide/
- http://imsciences.edu.pk/serg/2010/09/openerp-module-development-part-1/
There are some different method from that two sources:
- The first source using file named __openerp__.py as module descriptor file, but the 2nd source using file named __terp__.py
I don't why they using different file name... I will find out later - the first source says that we should zip folder as modulename.zip then instal to openerp through menu administration/import module,
but the 2nd source says that we just put the folder into folder openerpserver/addons but dont know the next procedure
So, I have try the first source and it was install successfully..
then I tried the 2nd source but with 1st source method to install the module.
- Zip the module
- Go to menu administration/modules/import module
- attach the zip file
- go to menu modules
- search module name I created
- click schedule for installation
- apply schedule upgrades
but it raises error such these:
openerp ZipImportError: bad local file header in pathtofile.zip
I search in google and founf this answer (http://www.openerp.com/forum/topic15598.html)
in server, unzip student_info.zip in addons/student_info (but warning, you do not have addons/student_info/student_info)
in client go to administration->modules, update list of modules, install your module.
If you use dia to build your modules, or generally, unzip it in addons before, and update list of modules.
in client go to administration->modules, update list of modules, install your module.
If you use dia to build your modules, or generally, unzip it in addons before, and update list of modules.
SO, the solution is:
- cancelling the installation of module
- unzip the modulename.zip in openerpserver/addons/
- remove modulname.zip file
- click menu administration/modules/update modules list
- search for my modulname
- schedule for installation
- apply schedule upgrades
then I can see the real error,
I fix it directly in openerpserver/addons/modulename
then I click apply schedule upgrades until success information appear
btw, the 2nd source will make you dizzy
because we will found some error when implemented that...
it just because different text fonts when you use quotes and double quotes
and there a line missing in sim.py
which is:
from osv import osv, fields
in first line
Hope this help
[python] NameError: name 'self' is not defined
Bismillah..
I'm currentlt learning about python..
I take this web as my guide.
http://www.sthurlow.com/python/
then in lesson 8 which i learn about how to create class i got problem...
Traceback (most recent call last):
File "D:/workspace/openerp/sourcecode/phython/lesson8class.py", line 1, in ?
class Shape:
File "D:/workspace/openerp/sourcecode/phython/lesson8class.py", line 17, in Shape
self.y = self.y * scale
NameError: name 'self' is not defined
I gugling... and found these simple answer in this link http://stackoverflow.com/questions/2963654/python-nameerror-self-is-not-defined:
The exception is happening while the class is being defined, which means that your indentation is off. Tabs in Python are equivalent to 8 spaces, so if all the preceding lines are using tabs and your tabstop is set to 4 spaces then the indentation only looks correct.
wuihihi... so make sure you use the correct IDE :D
Subscribe to:
Posts (Atom)