Solved

Python Error - OpenERP Module

Posted on 2014-10-10
5
435 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Looking for example pivot year code used in Y2K 4 61
Counting documents in a Domino View 3 62
Device same like our heart 12 74
Not needed 13 93
This is an explanation of a simple data model to help parse a JSON feed
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now