Python Error - OpenERP Module

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'
LVL 1
joe_echavarriaDatabase AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

joe_echavarriaDatabase AdministratorAuthor Commented:
This is the error i am receiving

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

 when installing the module.  It is OpenERP 7
0
joe_echavarriaDatabase AdministratorAuthor Commented:
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
joe_echavarriaDatabase AdministratorAuthor Commented:
I solved the problem.

I found the information in this link :

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.