Odoo 9 custom module binary field attachment=True parameter added later after that new record will be stored in filesystem storage. Binary Fields some old records attachment = True not used, so old record entry not created in ir.attachment table and filesystem not saved. I would like to know how to migrate old records binary field value store in filesystem storage?. How to create/insert records in ir_attachment row based on old records binary field value? Is any script available?
相关问题
- TFS Power tools Migrate doesn't actually migra
- Most efficient way to turn factor matrix into bina
- Cast some light on population count algorithm
- Haskell - How to create a mapTree function based o
- Upload linux binary file to maven repository
相关文章
- How to get path of the php binary on server where
- Unsigned char c = 255 is “11111111” or not?
- Reading records from a Fortran binary file in Pyth
- Java: Why doesn't binary OR work as expected (
- Reading a binary map file in r
- Load file into IMAGE object using Phantom.js
- Convert Binary to Decimal Haskell
- Java- How would I load a black and white image int
I'm sure that you no longer need a solution to this as you asked 18 months ago, but I have just had the same issue (many gigabytes of binary data in the database) and this question came up on Google so I thought I would share my solution.
When you set attachment=True the binary column will remain in the database, but the system will look in the filestore instead for the data. This left me unable to access the data from the Odoo API so I needed to retrieve the binary data from the database directly, then re-write the binary data to the record using Odoo and then finally drop the column and vacuum the table.
Here is my script, which is inspired by this solution for migrating attachments, but this solution will work for any field in any model and reads the binary data from the database rather than from the Odoo API.
Afterwards, drop the column and vacuum the table in psql.
You have to include the postgre bin path in
pg_path
in your configuration file. This will restore the file store that contains the binary fields