El 23/04/18 a les 17:17, Francisco Maria Moyano Casco ha escrit: > El lunes, 23 de abril de 2018, 4:25:03 (UTC-3), Sergi Almacellas Abellana > escribió: >> El 22/04/18 a les 00:12, Francisco Maria Moyano Casco ha escrit: >>> Hi, >>> I am trying to put a default cost and list price, but had no success. >>> >>> The code am working on is the next one: >>> >>> ............ >>> @staticmethod >>> def default_list_price(): >>> return 1.0 >>> .............. >>> >>> I know that both fields are Property fields, and that is why my code >>> doesn't work. >>> >>> I am inventoring all my assets, and I need to have some defaults values >>> on the product.template >>> >>> Regards. >>> Francisco >>> >> Property fields have their default on the Property table. You should >> create a record with the field and not related to any record and this >> will be used as default value. >> > Sorry for bothering again. Is there any example on any module I could use? > I understand your reply, but I am not sure how to use it. You should create a record on the ir.property model. There is an example on the product module:
http://hg.tryton.org/modules/product/file/4.2/configuration.xml#l32 Just adapt the field search and the value. For the value make sure to use , as prefix which is required by design. -- Sergi Almacellas Abellana www.koolpi.com Twitter: @pokoli_srk -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/b272ce15-90ff-5736-9318-a68474cc3342%40koolpi.com.