Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
165 Tampilan

Hi all,

Maybe this is so simple that I am overlooking it. How would I retain the original file dates while importing files to Odoo? I am interested in the import date too (like now), but this is not my first concern. I would like Odoo to keep (and show) the original file date which of course could be ages ago...

Best regards

Avatar
Buang
Jawaban Terbai

Hi,
All files and their data are in the [Developper mode activated] 
→ settings > Technical > Attachements > open a file and you have the create date visible there.

I just verified and the files has a date field you can place on the list view (attachements)

Avatar
Buang
Jawaban Terbai

Hello Udo,



  To retain and display the original file date of documents imported into Odoo, you might need to customize your import process. Odoo, by default, does not store the original file creation or modification date in the database for attachments. However, you can achieve this by following these steps:

  1. Create a custom module or extend an existing one to add a new field for storing the original file date.

  2. Override the create method for attachments in your custom module to capture and store the original file's date. You can use Python's os.path.getmtime() or os.path.getctime() to get the modification or creation time of the file before it's uploaded to Odoo.

  3. Modify the view to display the original file date alongside the attachment. This might involve adjusting the form view of the model where you're attaching the file.


For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jul 25
776
0
Jul 25
9
1
Des 24
1611
1
Jul 25
738
3
Jul 25
941