El 31/01/18 a les 14:51, Maxime Richez ha escrit: > I decide to create a custom module to add a sequence on an existing field. In > my case, it concerns stock_lot module. There's a field "number" (type char, > required=true) that i need to be "sequenced".
I believe there is a generic need to create lot numbers with a sequence defined. Indeed nantic has a module which allows to configure the sequence based on the product or on the category [1]. I will be very happy if we find a generic solution that can be part of tryton. > Here's the code: https://pastebin.com/74EXsjT7 We use states to save pyson states which. If you want to make it always readonly you can do: @classmethod def __setup__(cls): super(Lot, cls).__setup__() cls.number.readonly = True [1] https://bitbucket.org/nantic/trytond-stock_lot_sequence/src -- Sergi Almacellas Abellana www.koolpi.com Twitter: @pokoli_srk -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/a77876ce-9474-9762-eb7c-7d60b7cec913%40koolpi.com.