I will do an abstract class with some childs, ex: "animal -> extended by dog and extended by cat".
the problem becomes when I want to list all the "animals" in the example.
example code:
class Animal(models.AbstractModel):
_name = "test.animal"
name = fields.Char("Name")
vel = fields.Float("Velocity")
class Dog(models.Model):
_name = "test.dog"
_inherit = ["test.animal"]
class Cat(models.Model):
_name = "test.cat"
_inherit = ["test.animal"]
Thank you
I have a superclasse “Animal” whose is abstract and some subclasses “dog, cat, horse...” whose extends animal.
The exemple code is:
class Animal(models.AbstractModel):
_name = "test.animal"
name = fields.Char("Name")
vel = fields.Float("Velocity")
class Dog(models.Model):
_name = "test.dog"
_inherit = ["test.animal"]
class Cat(models.Model):
_name = "test.cat"
_inherit = ["test.animal"]
I want to do a view that shows all the “animals”, including “cats, dogs,...”
De: Ermin Trevisan <trevi@twanda.com>
Enviado el: miércoles, 23 de octubre de 2019 17:23
Para: Joan Aldabó <joan.aldabo@midgard.cat>
Asunto: Re: view for generic class
Please be more specific. What is your problem?
Sent by Odoo S.A. using Odoo.