Skip to content
Snippets Groups Projects
  1. Jun 24, 2023
    • Denis Ledoux's avatar
      [FIX] base_import_module: restore `<field file="...">` feature · 2a3ef939
      Denis Ledoux authored
      
      Revision odoo/odoo@cabb9e7e573b86cd523980588360d8514090d370 introduced a
      regression: This is no longer possible to import a data module
      using `<field file="..."/>` in their data file.
      
      This revision targets to restore the feature as expected.
      The unit tests added covers the feature, so that regression
      no longer happens in the future.
      
      It introduces a new concept of temporary directory `file_open`
      can read from.
      e.g.
      ```py
      with odoo.tools.file_open_temporary_directory(self.env) as module_dir:
         with zipfile.ZipFile('foo.zip', "r") as z:
            z.extract('foo/__manifest__.py', module_dir)
         with odoo.tools.file_open('foo/__manifest__.py', env=self.env) as f:
            manifest = f.read()
      ```
      
      Note that `file_open` will be allowed to read from that temporary
      directory only if `env` is passed to `file_open`,
      and if the `env` is part of the same transaction/request than the `env`
      passed to `file_open_temporary_directory`.
      
      This is to avoid having users, whether from other databases,
      or even the same database,
      trying to access these directories not belonging to them.
      e.g. If an admin uploads sensitive data in this temporary directory,
      no one than him must be allowed to read from these files, not even
      another user from his database.
      
      closes odoo/odoo#126278
      
      closes odoo/odoo#126337
      
      Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
      2a3ef939
  2. Jun 18, 2023
  3. Jun 09, 2023
    • Denis Ledoux's avatar
      [FIX] base_import_module: restore module icon · 77939849
      Denis Ledoux authored
      
      The revision dd3f918c
      introduced a regression:
      it was no longer possible to set an icon in the import module,
      and if no icon is provided,
      the icon should fall back to the base module icon,
      which wasn't the case either.
      
      In this last case, it even leaded to a crash:
      ```
      File "/home/odoo/src/14.0/odoo/odoo/addons/base/models/ir_module.py", line 251, in _get_icon_image
          with tools.file_open(path, 'rb') as image_file:
        File "/home/odoo/src/14.0/odoo/odoo/tools/misc.py", line 176, in file_open
          return _fileopen(name, mode=mode, basedir=base, pathinfo=pathinfo, basename=basename, filter_ext=filter_ext)
        File "/home/odoo/src/14.0/odoo/odoo/tools/misc.py", line 211, in _fileopen
          raise ValueError("Unknown path: %s" % name)
      Exception
      ValueError: Unknown path: /base/static/description/icon.png
      ```
      
      opw-3340652
      
      closes odoo/odoo#124307
      
      Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
      77939849
  4. Jun 04, 2023
  5. May 02, 2023
    • Arnaud Baes's avatar
      [FIX] base_import_module: extract only used files and thread-safe · dd3f918c
      Arnaud Baes authored
      
      For performance reasons, instead of extracting the whole
      zip, extract only the files which are actually used
      during in the `_import_module`, in case people
      put additional crap in the archive which are ignored
      during the import. That way, we avoid useless I/O.
      
      Also, adding the temporary directory in the addons
      path wasn't thread-safe.
      This revision changes this to make the module
      import feature thread-safe.
      
      closes odoo/odoo#80120
      
      Signed-off-by: default avatarPierre Masereel <pim@odoo.com>
      dd3f918c
  6. Apr 30, 2023
  7. Apr 23, 2023
  8. Apr 09, 2023
  9. Mar 19, 2023
  10. Feb 26, 2023
  11. Jan 29, 2023
  12. Jan 15, 2023
  13. Jan 01, 2023
  14. Nov 18, 2022
  15. Jul 24, 2022
  16. Jul 10, 2022
  17. Jun 29, 2022
    • Thibault Francois's avatar
      [FIX] cloc: fix count of studio field + exclude sa · ecff2d13
      Thibault Francois authored
      This commit fix 3 problem
      
      Don't count studio field
      ------------------------
      
      the commit https://github.com/odoo/odoo/commit/75b8c4eb1ed6e44f427886eea06ad216995e16c8
      was supposed to stop counting count field generate by addins a smart
      button with studio.
      
      It works fine when base import module is not installed which is never
      the case.
      
      When base_import_module the field is counted as a field that belong
      to a imported module installed : studio_customization
      
      studio_customization should not be counted as an imported module
      installed
      
      Count Field with standard xml_id
      --------------------------------
      
      With https://github.com/odoo/odoo/commit/9afce4805fc8bac45fdba817488aa867fddff69b
      
      
      Each manual can end up with an xml_id from a standard module:
      the original module of the model
      
      A standard module should never create a manual field so we can consider
      they should be counted unless they match the criteria of the first
      problem
      
      If a field has a standard module xml_id and no other the module
      should be odoo/studio and not the name of the standard module
      
      Make possible to exclude some db record from cloc
      -------------------------------------------------
      It's possible to exclude some file in python module
      but it's not possible to exclude some field or SA in
      the database from the count
      
      Make it possible if they are link to an xml_id
      from the module __cloc_exclude__
      
      The exclude record will be shown in cloc report with
      the verbose mode
      
      closes odoo/odoo#94803
      
      X-original-commit: 58c3b45c
      Related: odoo/enterprise#28947
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      Signed-off-by: default avatarThibault Francois <tfr@odoo.com>
      ecff2d13
  18. May 01, 2022
  19. Mar 02, 2022
  20. Feb 15, 2022
  21. Oct 17, 2021
  22. Oct 03, 2021
  23. Aug 08, 2021
  24. Jul 26, 2021
    • Xavier-Do's avatar
      [FIX] *: add explicit license to all manifest · 4f683968
      Xavier-Do authored
      
      The license is missing in most enterprise manifest so
      the decision was taken to make it explicit in all cases.
      When not defined, a warning will be triggered starting from
      14.0 when falling back on the default LGPL-3.
      
      closes odoo/odoo#74231
      
      Related: odoo/enterprise#19850
      Related: odoo/design-themes#43
      Signed-off-by: default avatarXavier Dollé (xdo) <xdo@odoo.com>
      4f683968
  25. Jul 18, 2021
  26. Jul 11, 2021
  27. Jun 27, 2021
  28. Jun 20, 2021
  29. Jun 06, 2021
  30. Apr 25, 2021
  31. Mar 28, 2021
  32. Mar 14, 2021
  33. Mar 07, 2021
  34. Feb 21, 2021
  35. Feb 14, 2021
  36. Feb 07, 2021
  37. Jan 31, 2021
  38. Jan 17, 2021
  39. Jan 10, 2021
  40. Dec 27, 2020
Loading