No the Python datetime.timedelta store a fixed duration. Indeed you need to store a dateutil.relativedelta.relativedelta like it is done with account.invoice.payment_term.line.delta.
It may be a good improvement to have a reusable Mixin in trytond.
in addition, I saw that in base the field is stored in an interval type of postgres, wouldn’t it be easier to use the posgres possibility to store the data in months directly?
There is no exact matching for SQL INTERVAL in Python but a timedelta can always be stored as and retrieved from an INTERVAL (by using only days and seconds).
psyopg2 casting of INTERVAL
It uses the fixed values of 30 days per month and 365 days per year (which are the same default value used by the client to format timedelta).
But normally there should be no values above days in INTERVAL that Tryton writes.
A relativedelta can not be fully stored as an INTERVAL because it is missing some concept like weekday, day of the month etc.
In Tryton the data input is always a Python object so we can only use object that can be stored without loose.