Not really sure if its a string already but I'm trying to get the number of the week like this
>>> from datetime import datetime
>>> nweek = datetime.strptime(date_invoice,'%d/%m/%Y').isocalendar()[1]
and the result in odoo is 0, so I'm guessing its because the field "date_invoice" is a field type "date" and this strptime command works with strings, am I doing something wrong?
thanks
Try this: https://learnopenerp.blogspot.com/2021/07/how-to-use-and-convert-date-field-format-odoo.html