It is currently Mon May 21, 2012 7:25 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: There is no reference available for product.product
PostPosted: Mon Jun 13, 2011 12:47 am 
Offline

Joined: Wed Apr 23, 2008 10:36 am
Posts: 16
I've tried the following, and I don't understand what's wrong , why do I get the error in subject ?

class sale_subscription(osv.osv):
_name = "sale_subscription"
_description = "subscription"
_columns = {
'start_date' : fields.date('Date'),
'end_date' : fields.date('Date'),
'product_id': fields.many2one('product.product', 'Product'),
'active': fields.boolean('Active'),
}


Top
 Profile  
 
 Post subject: Re: There is no reference available for product.product
PostPosted: Mon Jun 13, 2011 1:51 pm 
Offline

Joined: Mon Sep 13, 2010 10:23 am
Posts: 54
Try like this

Code:
class sale_subscription(osv.osv):
_name = "sale_subscription"
_description = "subscription"
_columns = {
'start_date' : fields.date('Date'),
'end_date' : fields.date('Date'),
'product_id': fields.many2one('product.product', 'Product'),
'active': fields.boolean('Active'),
}

sale_subscription()

_________________
Arif


Top
 Profile  
 
 Post subject: Re: There is no reference available for product.product
PostPosted: Tue Jul 26, 2011 10:30 pm 
Offline

Joined: Wed Feb 02, 2011 9:01 pm
Posts: 4
check the depend attribute of your __openerp__.py file.

I put Product in it and it work after.

... well iam not sure that the reason why but it worked for me!


Top
 Profile  
 
 Post subject: Re: There is no reference available for product.product
PostPosted: Fri Jul 29, 2011 12:08 pm 
Offline

Joined: Thu Oct 28, 2010 1:51 pm
Posts: 53
Hi,
The __openerp__.py file has a list of module dependancys
e.g.:
"depends" : ["base","process","base_contact","product","sale","account_invoice_printed","email_account"],
Whatever you put in here (module names) are referenceable from your code.
If they are not in here you cannot reference them.

Best Regards,
Mike

_________________
Developing OpenERP Modules for what seems like an eternity
Smart IT Ltd
http://www.smart-ltd.co.uk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP