On 2018-01-02 14:08, Cato Nano wrote: > Karla, > > Il giorno venerdì 29 dicembre 2017 15:06:02 UTC+1, Karla Stenger ha scritto: > > 2017-12-29 7:31 GMT-03:00 Cato Nano <[email protected]>: > > > Hello, > > Hello > > > > > > > > Could anyone give me a brief, clear example of how to have a calculated > > > field ? > > > > > > I' m trying to have my first calculated field > > > > > > I have 2 Date fields and I want my calculated field to be the difference > > > in days between the 2 dates > > > > > > How do I set that ? > > > > You are looking for fields.Function [1] > > Thank you so much for your clarification, I think I understand now > > But I'm having a types problem > > I have 2 Date fields: startDate and endDate > > I want the difference in days > > I have this line > > return abs((self.endDate - self.startDate).days) > > But in the client I get this error > > TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType' > > NoneType ? I was expecting my dates to be datetime.date type !
Answered at http://www.tryton.org/~irclog/2018-01-02.log.html#t2018-01-02%2023:48 Please avoid to ask same questions on multiple channel in a so short time frame. -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- 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/20180102225209.GV3925%40kei.
