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

[18.0][MIG] fs_attachment: Migration to 18.0 #403

Open
wants to merge 70 commits into
base: 18.0
Choose a base branch
from

Commits on Oct 15, 2024

  1. Configuration menu
    Copy the full SHA
    67671a4 View commit details
    Browse the repository at this point in the history
  2. [IMP] fs_attachement: implements x-access

    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    4c26cc6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8d84d0c View commit details
    Browse the repository at this point in the history
  4. [IMP] fs_attachment: Declares maintainer

    Also fix typo into summary
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    3806c92 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    324fa5e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    204ee54 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7675e61 View commit details
    Browse the repository at this point in the history
  8. [IMP] fs_attachment: Speedup install

    Avoid recompute of new columns when installed on an existing database
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    d98405e View commit details
    Browse the repository at this point in the history
  9. [IMP] fs_attachment: Server Environement support

    Allows to provide configuration parameters through server environement files.
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    62e1b7f View commit details
    Browse the repository at this point in the history
  10. [IMP] fs_attachment: Simplify code.

    Remove code used to try to read file from the root filesystem and write into the specialized filesystem. This code was used to try to provide a way to manage staging environments by reusing the same filesystem storage but with a different directory_path depending of the environement. A simpler method is to configure use a different filesystem storage by environement. If a production database is restored in pre production env, you can declare a new filesystem storage with a different code to store the attachements by default and configure the filesystem storage from the production with information allowing to read documents stored in it but not to modify or delete existing documents. This make the implementation far more simple.
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    edca4e2 View commit details
    Browse the repository at this point in the history
  11. [FIX] fs_attachment: No new registry creation

    To create a new cursor, just ask to the current registry.... Loading a registry is very time consuming and could lead to deadlocks...
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    6b297ac View commit details
    Browse the repository at this point in the history
  12. [IMP] fs_attachment: store attachments linked to different model/fiel…

    …ds to different FS storages
    marielejeune authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e8de0cc View commit details
    Browse the repository at this point in the history
  13. [UPD] Update fs_attachment.pot

    oca-ci authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    d5f0a17 View commit details
    Browse the repository at this point in the history
  14. [UPD] README.rst

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    be93eaa View commit details
    Browse the repository at this point in the history
  15. [ADD] icon.png

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    a527cc6 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    aaed4ac View commit details
    Browse the repository at this point in the history
  17. fs_attachment 16.0.1.0.1

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e5c06d0 View commit details
    Browse the repository at this point in the history
  18. [FIX] fs_attachment: Fix streaming

    Fix image streaming
    Fix image streaming with resize
    Fix content size whithout x-send-file
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c7533d7 View commit details
    Browse the repository at this point in the history
  19. [UPD] README.rst

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    b035b43 View commit details
    Browse the repository at this point in the history
  20. [IMP] fs_attachment: Remose useless code

    This code was initially used to magically know if we need to obfusc or not the filename into the database. Since this option is now explicit, we can safely remove-it. Moreover, without this code it's now possible to migrate old storage_file contents to the new fs_* addons
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    12b42af View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    b49246e View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    b6b39cc View commit details
    Browse the repository at this point in the history
  23. [IMP] fs_attachment: Add history

    Add history for commit included from OCA#285 and the author to the contributors list
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    58399a3 View commit details
    Browse the repository at this point in the history
  24. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    465c5ca View commit details
    Browse the repository at this point in the history
  25. [FIX] fs_storage, fs_attachement: Missing sudo for technical models

    Before this change, users with basic access rights was no more able to create an attachment. The problem was caused by the need to access system information to determine in which file system the attachment should be created, when this sensitive information is not accessible to everyone. The change consists of reading this information in sudo to bypass this security restriction in this specific context.
    adrienpeiffer authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    05df14e View commit details
    Browse the repository at this point in the history
  26. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    158ca29 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    bd64099 View commit details
    Browse the repository at this point in the history
  28. Translated using Weblate (Spanish)

    Currently translated at 100.0% (65 of 65 strings)
    
    Translation: storage-16.0/storage-16.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/es/
    Ivorra78 authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    d3b1366 View commit details
    Browse the repository at this point in the history
  29. [FIX] fs_attachment: Avoid error on url compute

    Avoid error when the directory_path is not set on the storage when computing the attachement
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    70f734f View commit details
    Browse the repository at this point in the history
  30. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    79a4e05 View commit details
    Browse the repository at this point in the history
  31. Added translation using Weblate (Italian)

    mymage authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c490407 View commit details
    Browse the repository at this point in the history
  32. [FIX] fs_attachment: Avoid local variable redefine

    When manipulating the file system api through a local variable named *fs*,
    we observed some strange behavior when it was wrongly redefined in an
    enclosing scope as in the following example: *with fs.open(...) as fs*.
    This commit fixes this issue by renaming the local variable and therefore
    avoiding the name clash.
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    0a69156 View commit details
    Browse the repository at this point in the history
  33. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    4f3fcf4 View commit details
    Browse the repository at this point in the history
  34. Translated using Weblate (Italian)

    Currently translated at 36.9% (24 of 65 strings)
    
    Translation: storage-16.0/storage-16.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/it/
    mymage authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    b5325e3 View commit details
    Browse the repository at this point in the history
  35. [IMP] fs_attachment: Improve performance

    Before this change, when the fs_url was computed the computed value was always
    reassigned to the fs_url attribute even if the value was the same. In a lot of
    cases the value was the same and the reassignment was not necessary. Unfortunately
    this reassignment has as side effect to mark the record as dirty and generate a
    SQL update statement at the end of the transaction.
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    c43e470 View commit details
    Browse the repository at this point in the history
  36. Translated using Weblate (Italian)

    Currently translated at 100.0% (65 of 65 strings)
    
    Translation: storage-16.0/storage-16.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/it/
    mymage authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e6cb5e8 View commit details
    Browse the repository at this point in the history
  37. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    4f930bd View commit details
    Browse the repository at this point in the history
  38. [FIX] add a few missing sudo to fs_attachment

    fs.storage is protected as it contains credentials.
    It must be accessed sudo when needed for regular users
    manipulating ir.attachments.
    sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    5ee7965 View commit details
    Browse the repository at this point in the history
  39. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    ab82adf View commit details
    Browse the repository at this point in the history
  40. [FIX] fs_attachment: broken links when nonempty paths

    Let "image.png" be an image.
    Thumbnails might be created with a path such as "38/5b/image-128.png".
    Before, the path was forgotten when updating the attachment,
    so accessing the file would crash, making the record inaccessible.
    len-foss authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    15e8ed3 View commit details
    Browse the repository at this point in the history
  41. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    22218a8 View commit details
    Browse the repository at this point in the history
  42. Translated using Weblate (Italian)

    Currently translated at 100.0% (65 of 65 strings)
    
    Translation: storage-16.0/storage-16.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-16-0/storage-16-0-fs_attachment/it/
    mymage authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    05d7165 View commit details
    Browse the repository at this point in the history
  43. [IMP] fs_attachment: more robust pre_init_hook

    If say click-odoo-update fails partway, the columns are already created
    and the following tentative update fails because the columns exist.
    len-foss authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    5e4c2d3 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    5029f0a View commit details
    Browse the repository at this point in the history
  45. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    a07579b View commit details
    Browse the repository at this point in the history
  46. [FIX] compute the mimetype from new datas or raw to prevent errors wh…

    …en the new mimetype doesn't match the old one
    benwillig authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    b65d8ff View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    b026e45 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    ef15e92 View commit details
    Browse the repository at this point in the history
  49. [UPD] Update fs_attachment.pot

    oca-ci authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e765d0a View commit details
    Browse the repository at this point in the history
  50. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    4e53bea View commit details
    Browse the repository at this point in the history
  51. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: storage-17.0/storage-17.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_attachment/
    weblate authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    2835410 View commit details
    Browse the repository at this point in the history
  52. [FIX] pre-commit

    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    eb9ebef View commit details
    Browse the repository at this point in the history
  53. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    1d29e07 View commit details
    Browse the repository at this point in the history
  54. [UPD] Update fs_attachment.pot

    oca-ci authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    586d157 View commit details
    Browse the repository at this point in the history
  55. Update translation files

    Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
    
    Translation: storage-17.0/storage-17.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_attachment/
    weblate authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e797b4a View commit details
    Browse the repository at this point in the history
  56. [FIX] fs_attachment: fix constraint

    The method _check_force_db_for_default_attachment_rules() encountered issues when used with a constraints() decorator due to the computed field use_as_default_for_attachments, which is not stored in the database. This fix consists in replacing the constraints() decorator with a directly invoked method.
    astirpe authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    f0fca40 View commit details
    Browse the repository at this point in the history
  57. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    bc72b19 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    360f454 View commit details
    Browse the repository at this point in the history
  59. Translated using Weblate (Chinese (Simplified) (zh_CN))

    Currently translated at 100.0% (64 of 64 strings)
    
    Translation: storage-17.0/storage-17.0-fs_attachment
    Translate-URL: https://translation.odoo-community.org/projects/storage-17-0/storage-17-0-fs_attachment/zh_CN/
    xtanuiha authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e7877e7 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    2752db4 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    346dfe2 View commit details
    Browse the repository at this point in the history
  62. [IMP] fs_attachment: No crash on missing file

    When trying to get access to files stored into an external filesystem, don't crash if the files cannot be accessed. This is necessary to avoid blocking Odoo's operation if an external system is not accessible.
    lmignon authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    206d9b4 View commit details
    Browse the repository at this point in the history
  63. [FIX] fs_attachment: prevent recompute_urls from skipping records wit…

    …h res_field != False
    PabloEForgeFlow authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    eba9319 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    2119d70 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    d2da214 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    4524f9c View commit details
    Browse the repository at this point in the history
  67. [BOT] post-merge updates

    OCA-git-bot authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    9013015 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    c2b39bb View commit details
    Browse the repository at this point in the history
  69. [MIG] fs_attachment: Migration to 18.0

    qgroulard authored and sbidoul committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    edd8bf0 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    0eb78b9 View commit details
    Browse the repository at this point in the history