?
Solved

Python Error - OpenERP Module

Posted on 2014-10-10
5
Medium Priority
?
464 Views
Last Modified: 2014-10-24
Hi,

  I am new to Python and Openerp module creation.   I am learning from a tutorial, but can not install the first module because of an error.   Below is the error and the contents of all the files of the module.

 Please help to find out what i am doing wrong.

File :
__init__.py
import vetclinic

Open in new window

File :
__openerp__.py
{
    'name' : 'VetClinic',
    'version': '1.0',
    'description': """
	Vet Clinic Application
  	   - List of Animals
   	   - List of Breeds
           - Create appointments
  """,

     'author' : ' Greg',
     'website' : 'www.mysite.com',
     'depends' :['base_setup'],
     'data' : ['vetclinic_view.xml'],
     'demo' : [],
     'installable' : True,
     'auto_install' : False,
} 

Open in new window

File :
vetclinic.py
from osv import osv, fields
class vetclinic_animal(osv.Model):
    _name = "vetclinic.animal"
    _columns = {
 	'name':fields.char('Name',size=64),
        'birthdate' : fields.date('Birth Date'),
  }

Open in new window

File :
vetclinic_view.xml
<?xml version="1.0" encoding="utf-8"?>
 <openerp>
   <data> 
 	<record id="vetclinic_animal_action" model="ir.actions.act_window">
          <field name="name">Animals</field>
          <field name="res_model">vetclinic.animal</field<
          <field name="view_type">form</field>
          <field name="view_mode">tree,form</field>
          <field name="help" type="html">
 		<p class="oe_view_nocontent_create">Click create to add a new animal record</p>
	  </field>
	   
        </record>	


	 <menuitem id="vetclinic" name="Vet Clinic"/> 
         <menuitem id="vetclinic_menu"  name="Vet Clinic" parent = "vetclinic" />
         <menuitem id="vetclinic_animal_menu" 
		 name="Animals" 
	         parent="vetclinic_menu 
	         action="vetclinic_animal_action"
          />    

   </data>

</openerp>

Open in new window




Error:

Client Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\http.py", line 204, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\controllers\main.py", line 1132, in call_button
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\controllers\main.py", line 1120, in _call_kw
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\session.py", line 42, in proxy
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\session.py", line 30, in proxy_method
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\session.py", line 103, in send


Server Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\web\session.py", line 89, in send
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\osv\osv.py", line 190, in execute_kw
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\osv\osv.py", line 132, in wrapper
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\osv\osv.py", line 199, in execute
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\osv\osv.py", line 187, in execute_cr
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\base\module\wizard\base_module_upgrade.py", line 90, in upgrade_module
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\pooler.py", line 39, in restart_pool
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\registry.py", line 233, in new
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 354, in load_modules
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 256, in load_marked_modules
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\loading.py", line 159, in load_module_graph
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\module.py", line 405, in load_openerp_module
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\.\openerp\modules\module.py", line 133, in load_module
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\vetclinic\__init__.py", line 1, in <module>
  File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\vetclinic\vetclinic.py", line 3, in <module>
AttributeError: 'module' object has no attribute 'model'
0
Comment
Question by:joe_echavarria
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 1

Author Comment

by:joe_echavarria
ID: 40399929
This is the error i am receiving

AttributeError: 'module' object has no attribute 'model'

 when installing the module.  It is OpenERP 7
0
 
LVL 1

Author Comment

by:joe_echavarria
ID: 40399939
This is the error i am receiving

AttributeError: 'module' object has no attribute 'model'
 File "C:\Program Files (x86)\OpenERP 7.0-20140622-231040\Server\server\openerp\addons\vetclinic\vetclinic.py", line 3, in <module>


When installing the module.  It is OpenERP 7.

I can not find the erro in that file, on that line.
0
 
LVL 1

Accepted Solution

by:
joe_echavarria earned 0 total points
ID: 40402932
I solved the problem.

I found the information in this link :

http://stackoverflow.com/questions/456867/attributeerror-module-object-has-no-attribute-model
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question