inheritance - OpenERP 7.0: Why does product.product inherit from product.template? -


what advantage gained having product.product inherit product.template instead of defining fields directly in product.product?

_name = "product.product" _description = "product" _inherits = {'product.template': 'product_tmpl_id'} 

when use technique in new code?

when using _inherits kind of polymorphic model in database way.

for example product.product inherits product.template or res.users inherits res.partner. mean create model gets know how of model adds aditional data/columns in new database table. when create user, partner data stored in res_partner table (and partner created) , user related info stored in res_users table.

to use dict: _inherits = {'res.partner': 'partner_id'} key corresponds base model , value foreign key base model.

from here can mix inheritance if dare...

here links:

http://help.openerp.com/question/46/the-different-openerp-model-inheritance-mechanisms-whats-the-difference-between-them-and-when-should-they-be-used/

https://doc.openerp.com/v6.0/developer/2_5_objects_fields_methods/object_inherits/

hope helps.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -