On 08/02/13 08:35 +0100, Raimon Esteve wrote: > Hello > > I understand "the reasons" about don't use inherit published some weeks > ago, but I think inherit help users to more simple management. > > For example, product. Usually customers are working by "products simples". > They don't need understand about product.product and product.template. > > Yesterday I saw a concept about split product module in product and > template. (tuit from céd).
I did not split, it was already. > Product and party are models/views to add more custom fields. Yes like any other Tryton Model, you can add custom fields as much as you want. > If you split > template/product, finally we are working to "product oneclick", a module to > add a wizard to easy create products (basic profuct fields) for dummies > users, for example ;-) The view I was working on [1] is not very different from the current one (just the code has to move and there are 2 active fields). You will still be able to just create a product via the template form without any additional requirements. Maybe we should try to have better names than "Product Template" and "Product": "Product" and "Variant" ? But at least, with this design the user could have a clear understanding of what is happening. > I think use inherit is a good idea (I like it). > > In Django we can "inherit" python class. It's similar a inherit > openerp/tryton and maybe this is usefull. Create two tables in database. > > class BlogBase(models.Model): > > class Blog(BlogBase): It is not really, it is based on a One2One relation which doesn't fit well in a DB schema. > I don't try in tryton but I think is possible (I'm ill to try it) and in > tryton we could inherit views Yes you can but it is completly different concept as the inherits [2]. Because it the fields from parent will be created in the child. So it is just the Python code that is shared not the storage in DB. [1] https://twitter.com/cedrickrier/status/299589886040764416/photo/1 [2] http://hg.tryton.org/trytond/file/8098fe4285b2/trytond/ir/sequence.py#l349 -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: cedric.kr...@b2ck.com Website: http://www.b2ck.com/
pgpZ1ZyaSXrhf.pgp
Description: PGP signature