2014-07-24 18:34 GMT+02:00 Cédric Krier <cedric.kr...@b2ck.com>: > On 24 Jul 18:22, Guillem Barba Domingo wrote: > > Hi, > > > > it's known that there is in the roadmap to remove "ir.property" from > Tryton. > > > > To be prepared for this change, which we strongly endorse, NaN·tic and > > ZikZakMedia have started to implement company dependant values as > > Functional fields which get the value from auxiliar model. > > > > You can find an example of company dependant configuration field here [1] > > and company dependant party field (as example of instanciable model) here > > [2]. > > You can see that getter and setter could be generalized, and if two > modules > > need to add "company related" fields to the same model we will have > > repeated code and, maybe, some issues because of define twice (or more > > times) the same model/field. > > > > For these reason, I propose that company module provide some Mixin and > > other "infraestructure" to avoid duplicate code. You can find a PoC of > > Mixin I propose here [3] and example that use it it here [4]. > > > > I also think that models to store "company dependant" fields should be > > provided by core modules (I'm talking about "product.category.company" in > > [4]). > > > > What do you think? > > I think there is no need of mixin. Indeed using a mixin will just > reproduce the same issue as for Property field. >
I don't understand. Without mixin we will have the same code in lot of modules, event repeated for the same model -- Guillem Barba http://www.guillem.alcarrer.net