It is currently Sun Feb 12, 2012 9:05 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Problem with inheritance by prototyping
PostPosted: Tue Jan 19, 2010 12:46 pm 
Offline

Joined: Tue Jan 19, 2010 12:33 pm
Posts: 2
Hi everyone,

I'm quite new to openerp, and I have a small problem with object inheritance.

According to the documentation athttp://doc.openerp.com/developer/2_5_Objects_Fields_Methods/object_inherit.html to create a new object with fields of an existing object we can use _inherit = "existing.object" with _name != _inherit.

I'm trying to create a template of a product, that should have all the columns of a product and a few additional columns.

Here is my model:

Code:
class product_template(osv.osv):
    _name = 'variations.product_template'
    _inherit = 'product.product'
    _description = 'Template'
    _columns = {
         'name' : fields.char('Name', size=32, required=True),
         }
product_template()


and the view

Code:
<tree>
<record>
    <field>variations.template.tree</field>
    <field>variations.product_template</field>
    <field>tree</field>
    <field>
       <tree>
           <field>
        </tree>
    </field>
</record>
</tree>


As you can see product_template inherits by product.product. The view references my own model, not product.

The problem is that if I open the template tree, it displays a list of products, not the templates. I checked the DB and seems fine, there is a table (empty) for product_template. I can't figure out what is going wrong.

Thanks in advance

Riccardo


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

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:
cron

Protected by Anti-Spam ACP