Skip to content
Snippets Groups Projects
  1. Oct 04, 2021
    • Xavier Morel's avatar
      [FIX] web: more reliably avoid downloads on new file · 0eccd397
      Xavier Morel authored
      
      51955505 mitigated an issue of being
      able to try and download files which don't exist yet, make the fix
      more reliable by clearing out the field completely and hiding the
      content if the (readonly) field has no value *or the record is not
      saved yet*.
      
      Also clean up the code:
      
      * an old-style forward port created a duplicate fixprovement
        (a8d01cbf) which seems less correct
        as it applies conditionally
      * and the code is branchier than necessary, we can make it simpler by
        judiciously leveraging jquery's API
      
      closes odoo/odoo#77603
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      0eccd397
  2. Jun 16, 2021
    • Denis Ledoux's avatar
      [FIX] fields: use `SAVEPOINT` when really creating the index · 5b281c3c
      Denis Ledoux authored
      
      `update_db_index` is meant
      to skip the creation of the index if it fails.
      
      It therefore uses `with cr.savepoint()` for that purpose
      
      But, before this revision, it surrounds `create_index`,
      in which the index creation is skipped if it already exists.
      
      Meaning, if the index already exists,
      a savepoint was created for nothing.
      
      Creating a savepoint has a cost.
      Therefore, avoiding to create one when it's not necessary
      is better for the performances.
      
      In addition, during an installation / upgrades,
      a lot of index are attempted to be created,
      and the performance of postgresql are degraded
      when there are more than 64 savepoints within the same transaction,
      which could easily happen when installing/updating a module,
      while attempting to create all its indexes (despite they already existed).
      
      Moving only the `with cr.savepoint`, without moving the `try..except`
      will have no impact on the API. It's still the role
      of the method calling `create_index` to catch the exception
      if it wants to.
      Besides, for the methods which are calling `create_index`
      without a `try..except` block, the transaction will still
      be rollbacked, as it's the case for any uncatched exception
      in Odoo.
      
      There is therefore no downside to move `cr.savepoint` into `create_index`.
      
      closes odoo/odoo#71565
      
      Signed-off-by: default avatarDenis Ledoux (dle) <dle@odoo.com>
      5b281c3c
  3. May 20, 2021
    • Xavier Morel's avatar
      [FIX] base: confusion between werkzeug.urls and urls local · 0cfe528d
      Xavier Morel authored
      
      As part of the Python 3 compatibility effort,
      01e35141 moved all uses of urllib(2)
      to werkzeug & requests as the packages were renamed and reorganised
      between P2 and P3.
      
      For `module.py`, it looks like I confused the `urls` local variable
      for an already imported `werkzeug.urls` and just tried calling
      `url_parse` on that. Which doesn't work, because `urls` is a
      dict.
      
      Fixes #71076
      
      closes odoo/odoo#71080
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      0cfe528d
  4. May 01, 2021
  5. Apr 27, 2021
  6. Apr 15, 2021
  7. Apr 01, 2021
  8. Mar 01, 2021
  9. Feb 19, 2021
  10. Feb 01, 2021
  11. Jan 13, 2021
    • Moises Lopez's avatar
      [FIX] requirements.txt: module 'stdnum.eu.vat' has no attribute '_country_codes' · 85c421d2
      Moises Lopez authored
      The vatnumber is pinned to version 1.2 in the requirements.txt:
       -https://github.com/odoo/odoo/blob/85f3fe323c9105827931febda04745a55c1f44a4/requirements.txt#L41
      
      but vatnumber does not have a pinned version to stdnum package
      
      So, it is installed the last version even if it is not compatible
      
      A new version was released of stdnum 1.15 on Jan 11, 2021
       - https://pypi.org/project/python-stdnum/1.15/
      
      But it is not compatible with odoo@11.0 anymore because of
      there is not exists the following attribute:
       - stdnum.eu.vat._country_codes or stdnum.eu.vat.country_codes
      
      Used in the following line:
       - https://github.com/odoo/odoo/blob/85f3fe323c9105827931febda04745a55c1f44a4/addons/base_vat_autocomplete/models/res_partner.py#L15-L17
      
      
      
      So, the following error will raised:
      
          2021-01-12 22:40:39,897 155 CRITICAL DB odoo.modules.module: Couldn't load module base_vat_autocomplete
          2021-01-12 22:40:39,897 155 CRITICAL DB odoo.modules.module: module 'stdnum.eu.vat' has no attribute '_country_codes'
          2021-01-12 22:40:39,905 155 WARNING DB odoo.modules.loading: Transient module states were reset
          2021-01-12 22:40:39,906 155 ERROR DB odoo.modules.registry: Failed to load registry
          Traceback (most recent call last):
          File "./modules/registry.py", line 85, in new
          odoo.modules.load_modules(registry._db, force_demo, status, update_module)
          File "./modules/loading.py", line 380, in load_modules
          loaded_modules, update_module, models_to_check)
          File "./modules/loading.py", line 274, in load_marked_modules
          perform_checks=perform_checks, models_to_check=models_to_check
          File "./modules/loading.py", line 137, in load_module_graph
          load_openerp_module(package.name)
          File "./modules/module.py", line 368, in load_openerp_module
          __import__('odoo.addons.' + module_name)
          File "<frozen importlib._bootstrap>", line 969, in _find_and_load
          File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
          File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
          File "./modules/module.py", line 82, in load_module
          exec(open(modfile, 'rb').read(), new_mod.__dict__)
          File "<string>", line 4, in <module>
          File "./base_vat_autocomplete/models/__init__.py", line 4, in <module>
          from . import res_partner
          File "./base_vat_autocomplete/models/res_partner.py", line 17, in <module>
          stdnum_vat.country_codes = stdnum_vat._country_codes
          AttributeError: module 'stdnum.eu.vat' has no attribute '_country_codes'
          2021-01-12 22:40:39,907 155 CRITICAL DB odoo.service.server: Failed to initialize database `DB`.
          Traceback (most recent call last):
          File "./service/server.py", line 1043, in preload_registries
          registry = Registry.new(dbname, update_module=update_module)
          File "./modules/registry.py", line 85, in new
          odoo.modules.load_modules(registry._db, force_demo, status, update_module)
          File "./modules/loading.py", line 380, in load_modules
          loaded_modules, update_module, models_to_check)
          File "./modules/loading.py", line 274, in load_marked_modules
          perform_checks=perform_checks, models_to_check=models_to_check
          File "./modules/loading.py", line 137, in load_module_graph
          load_openerp_module(package.name)
          File "./modules/module.py", line 368, in load_openerp_module
          __import__('odoo.addons.' + module_name)
          File "<frozen importlib._bootstrap>", line 969, in _find_and_load
          File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
          File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
          File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
          File "./modules/module.py", line 82, in load_module
          exec(open(modfile, 'rb').read(), new_mod.__dict__)
          File "<string>", line 4, in <module>
          File "./base_vat_autocomplete/models/__init__.py", line 4, in <module>
          from . import res_partner
          File "./base_vat_autocomplete/models/res_partner.py", line 17, in <module>
          stdnum_vat.country_codes = stdnum_vat._country_codes
          AttributeError: module 'stdnum.eu.vat' has no attribute '_country_codes'
          2021-01-12 22:40:39,908 155 INFO DB odoo.service.server: Initiating shutdown
          2021-01-12 22:40:39,908 155 INFO DB odoo.service.server: Hit CTRL-C again or send a second signal to force the shutdown.
      
      Fixed pinning the last version compatible python-stdnum<=1.14
      
      closes odoo/odoo#64447
      
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      85c421d2
  12. Jan 01, 2021
  13. Dec 03, 2020
  14. Dec 01, 2020
  15. Nov 14, 2020
  16. Nov 18, 2020
  17. Nov 08, 2020
    • Xavier Morel's avatar
      [FIX] portal: internal & portal groups are largely exclusive · ec541ced
      Xavier Morel authored
      Prevent mistakenly adding "portal" to existing internal users through
      the portal wizard as that can lead to odd behaviors (to the extent
      that since 12.0 the "user type" uses radio buttons so it's not
      possible to easily set a user as both internal and portal).
      ec541ced
  18. Nov 13, 2020
  19. Nov 07, 2020
  20. Nov 10, 2020
    • Alexandre Kühn's avatar
      [FIX] mail: use consistent placeholder · 4179af66
      Alexandre Kühn authored
      When generation the message. add the name of the channel with a
      placeholder. In some languages like Japanese, the order of words is
      different and adding the name at the end makes an incorrect sentence,
      it was not possible to properly translate it.
      4179af66
  21. Nov 14, 2020
  22. Nov 15, 2020
  23. Nov 07, 2020
  24. Nov 18, 2020
  25. Nov 21, 2020
  26. Nov 16, 2020
  27. Nov 09, 2020
  28. Nov 13, 2020
    • Fanny He's avatar
      [FIX] product: Move onchange for Decimal Accuracy and UOM to product · 889e7c76
      Fanny He authored
      
      The commit
      97430bba609882cd734b79f89f903d7894266145
      set 2 warnings on Units of Measure and Decimal Accuracy.
      However this introduced a bug, here are the steps to reproduce:
      - Install decimal_precision
      - In debug mode, go to Decimal Accuracy
      - Create: traceback
      
      Based on commit
      916df82eba1a98cd5a6c780f2e7ca16356fa640c
      we move one warning from decimal_precision to product, and modify the
      translations accordingly.
      
      closes odoo/odoo#61704
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      889e7c76
  29. Oct 28, 2020
    • Daniel Duque's avatar
      [FIX] core: missing default values with inherits · dfce8a61
      Daniel Duque authored
      
      Consider some model A that "_inherits" from model B, which itself
      "_inherits" from model C.  Also consider a field F on model C, which is
      inherited by both models B and A.  Now create a record from model A,
      with a given record for model C, no record for model B, and a default
      value for field F.  This should create a record in A, connected to a new
      record in B, connected to the given record in C, and the default value
      should be ignored, as a record from C is given.
      
      Before this commit, the given record in C is modified with the default
      value for F.  The default value is considered because no record is given
      for B, and that value is used to modify the given record in C.  The fix
      consists in discarding default values by considering potential ancestor
      records when parent records are not given.
      
      closes odoo/odoo#60898
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Co-authored-by: default avatarRaphael Collet <rco@odoo.com>
      dfce8a61
    • Daniel Duque's avatar
      [CLA] FactorLibre · af397060
      Daniel Duque authored
      af397060
  30. Nov 01, 2020
  31. Jul 06, 2020
    • Andreas Perhab's avatar
      [FIX] website_blog: prevent error when no blog posts are published · e771ebf1
      Andreas Perhab authored
      
      blog.blog has no attribute post_date therefore as a fallback we need to use the
      write_date of the blog.blog element when no blog.posts are published.
      
      this prevents the following error:
      ```
      File "/opt/odoo/custom/src/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 353, in _compiled_fn
          raise QWebException("Error to render compiling AST", e, path, node and etree.tostring(node[0], encoding='unicode'), name)
      odoo.addons.base.ir.ir_qweb.qweb.QWebException: 'blog.blog' object has no attribute 'post_date'
      Traceback (most recent call last):
        File "/opt/odoo/custom/src/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 346, in _compiled_fn
          return compiled(self, append, new, options, log)
        File "<template>", line 1, in template_1400_458
      AttributeError: 'blog.blog' object has no attribute 'post_date'
      ```
      
      closes odoo/odoo#54116
      
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      e771ebf1
  32. Oct 25, 2020
  33. Oct 18, 2020
  34. Oct 13, 2020
    • Victor Feyens's avatar
      [REV] base: revert 3e77072f · b9fa6489
      Victor Feyens authored
      
      Revert commit
      "[FIX] base: clearer message in case of conflict for no_gap sequences"
      
      This commit changed the error returned in case of SQL conflict for no_gap
      sequences, wrongly disabling the automatic retry (service/model.py) in case
      of such errors.
      
      Also adds a comment in the dedicated test to ensure the behavior is explained
      and the automatic retry isn't broken once again by the same kind of change.
      
      closes odoo/odoo#59829
      
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      b9fa6489
  35. Oct 11, 2020
  36. Oct 05, 2020
Loading