Allow "Mixin" views

We’ve got a case in which we created a Mixin that is used in several models (ie: The mixin adds a bunch of fields.

As we want to keep views consistent among all those models inheriting the Mixin, what we did in previous versions of Tryton was to register the “abstract” model and add some views to it (such as and, so later, other “real” models could inherit those views.

We were forced to register the Mixin because Tryton does not allow us to register views that are not linked to a model (the “model” field is required), although it supports inheriting views from other models.

I think it makes perfect sense to make “model” field not required as it makes sense in cases such as the one in the example.


I do not think it will be a good thing. If you have a view that goes with a Mixin, you can:

  • override ModelView._view_look_dom_arch to add tags
  • define view that uses the same XML

I don’t understand this point.

I think the idea is available a “base” view and other views inherit the “base” view to add more fields. Same as Mixin in python or “extends” in Jinja2 template.