Advertisement
Guest User

Untitled

a guest
Aug 18th, 2015
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. class Brand(models.Model):
  2.     _name = 'product_application.brand'
  3.  
  4.     name = fields.Char()
  5.     models_ids = fields.One2many('product_application.model', 'brand_id', string="Models")
  6.  
  7.  
  8. class Model(models.Model):
  9.     _name = 'product_application.model'
  10.  
  11.     name = fields.Char()
  12.     brand_id = fields.Many2one('product_application.brand', string="Brand")
  13.     versions_ids = fields.One2many('product_application.version', 'model_id', string="Versions")
  14.  
  15.  
  16. class Version(models.Model):
  17.     _name='product_application.version'
  18.  
  19.     name = fields.Char()
  20.     model_id = fields.Many2one('product_application.model',string="Model")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement