Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make binary fields default to attachment=True #29308

Closed

Conversation

Projects
None yet
4 participants
@xmo-odoo
Copy link
Collaborator

commented Dec 6, 2018

Because custom/studio doesn't provide for specifying this parameter (and it's unclear how this could be handled e.g. what if a user decided to switch back and forth between attachment and not attachment?) custom binary fields are currently created with attachment=False, and since they're mostly used to associate images or documents to records that quickly bloats database's on-disk and backup sizes without the ability to hardlink/dedup provided by the filestore.

Flip the default, and adapt the existing binary fields.

Task 1909942

@robodoo robodoo added the seen 🙂 label Dec 6, 2018

@C3POdoo C3POdoo added the RD label Dec 6, 2018

@robodoo robodoo added the CI 🤖 label Dec 6, 2018

@xmo-odoo xmo-odoo force-pushed the odoo-dev:master-attachment-by-default-xmo branch Dec 7, 2018

@robodoo robodoo removed the CI 🤖 label Dec 7, 2018

@rco-odoo

This comment has been minimized.

Copy link
Member

commented Dec 7, 2018

@xmo-odoo see the error: the field logo_web on res.company must be stored in the database.

[CHG] *: make binary fields default to attachment=True
Check that it makes custom binary fields into attachment as that's the
main reason for the change: when users create binary fields via Studio,
they're necessarily db-stored (as the interface doesn't allow altering
the attachment attribute and it's unclear how we'd handle users
switching it on/off every time), which significantly bloats their
database (and burns storage & backup space), especially as the primary
use case for binary fields is adding images and documents to records.

* check that binary fields are properly created as attachment=True
* add attachment=False on fields where that seems relevant (most but not
  all of the fields previously using the default)
* remove occurrences of attachment=True

@xmo-odoo xmo-odoo force-pushed the odoo-dev:master-attachment-by-default-xmo branch to b709d1b Dec 7, 2018

@robodoo robodoo added the CI 🤖 label Dec 7, 2018

@rco-odoo

This comment has been minimized.

Copy link
Member

commented Dec 10, 2018

@robodoo robodoo added the r+ 👌 label Dec 10, 2018

robodoo pushed a commit that referenced this pull request Dec 10, 2018

[CHG] *: make binary fields default to attachment=True
Check that it makes custom binary fields into attachment as that's the
main reason for the change: when users create binary fields via Studio,
they're necessarily db-stored (as the interface doesn't allow altering
the attachment attribute and it's unclear how we'd handle users
switching it on/off every time), which significantly bloats their
database (and burns storage & backup space), especially as the primary
use case for binary fields is adding images and documents to records.

* check that binary fields are properly created as attachment=True
* add attachment=False on fields where that seems relevant (most but not
  all of the fields previously using the default)
* remove occurrences of attachment=True

closes #29308
@robodoo

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2018

Merged, thanks!

@robodoo robodoo closed this Dec 10, 2018

@rco-odoo rco-odoo deleted the odoo-dev:master-attachment-by-default-xmo branch Dec 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.