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?

[1]
https://bitbucket.org/nantic/trytond-stock_lot_sequence/src/fa7ee7e76ac880829efe5d0363cd0e268cc4d3ff/stock.py?at=default
[2]
https://bitbucket.org/trytonspain/trytond-company_bank/src/e3543f83f88ab8e6fe3c827a3981fd4de9641d94/party.py?at=default
[3]
https://bitbucket.org/nantic/trytond-product_configuration/src/8c8e8fca3c81f6256fb3fabd4885e16fab676cbc/helper.py?at=default
[4]
https://bitbucket.org/nantic/trytond-product_configuration/src/8c8e8fca3c81f6256fb3fabd4885e16fab676cbc/product.py?at=default

-- 
Guillem Barba
http://www.guillem.alcarrer.net

Reply via email to