On 23 maig de 2016 11:36:31 CEST, Maxime Richez <[email protected]> wrote: >Hello, > >Is it possible to define a default value in a field that depends on the > >previously entered data? > >For example, I have a model with detail rows (product, quantity, >prix_unitaire, currency): > >By default the value of my currency is the currency of my company. >If I have to introduce more detail lines with a currency different from > >that of my company, to avoid to select this currency every time, is it >possible to imagine that the default value of the currency come from >the >value of the previous detail row (and if it's the first line the >currency >of the company)? did the context keeps the last entered values?
You can use an on_change_with that depends on the parent field which will be called by the tryton client and you can compute the value as you want. > >Thanks for your help... Hope it helps! -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- 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/191F882F-2C1D-4BE6-A07A-B9DCEB6B4889%40koolpi.com.
