Reputation: 13372
I have on a disk PDF files of previous employee payslips. I would like to load them to OpenERP, as attachments to each employee. Furthermore, I would like to attach more files every month. To achieve this I want to write a specific module/addon, or a Python program accessing OpenERp through XML-RPC.
How should I interact with the employee model to programmatically attach a file? Is there an ORM method that can be used for this?
Upvotes: 2
Views: 2619
Reputation: 56230
If you want to do more advanced things with attachments, I suggest you check out the document
module, as well as the document_ftp
module. They store the attachments in the file system, so you can just copy the files in instead of going through the API. We used the FTP server in OpenERP 5.0, and it worked well for attaching large numbers of files.
Be careful, though. When you install these modules, I think you lose all current attachments. You'll have to migrate those attachments to the file system somehow.
Upvotes: 1
Reputation: 11
Use openerp import / export feature.
Make csv file and then do import.
Upvotes: 0