odoo/o-spreadsheet#4497

Created by BI, Adrien Minne (adrm)
Merged at 96506e48fd7388fe6822210876fde191edd7029c

Statuses:

label
odoo:17.0-set-default-translations-as-loaded-adrm
head
dd35ef6485643c798f54d93cae0d8db90dac1ac4
merged
4 months ago by BI, Pierre Rousseau (pro)
odoo/o-spreadsheet
17.0 #4497
saas-17.1 #4509
saas-17.2 #4510
saas-17.3 #4512
master #4513

[FIX] model: mark default translations as loaded

Description

Currently the default translations function is marked as not loaded. That means that if no custom translation method is set, the translations will never be marked as loaded, and charts will crash because we try to deepCopy LazyTranslatedString.

However we can't mark the default translations as loaded by default, because otherwise top-level translations would always be translated before we can set the translation method.

The solution is to mark the default translations as loaded only when starting the model.

Task: : 3999116

review checklist

  • [ ] feature is organized in plugin, or UI components
  • [ ] support of duplicate sheet (deep copy)
  • [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • [ ] in model/UI: ranges are strings (to show the user)
  • [ ] undo-able commands (uses this.history.update)
  • [ ] multiuser-able commands (has inverse commands and transformations where needed)
  • [ ] new/updated/removed commands are documented
  • [ ] exportable in excel
  • [ ] translations (_t("qmsdf %s", abc))
  • [ ] unit tested
  • [ ] clean commented code
  • [ ] track breaking changes
  • [ ] doc is rebuild (npm run doc)
  • [ ] status is correct in Odoo

  1. https://github.com/odoo/odoo/blob/8346b2a7561c178fd7e9f9d1fbd7dac3e3843fd1/addons/account/models/account_move.py#L912 ↩↩↩↩↩↩↩↩

  2. https://github.com/odoo/odoo/blob/8346b2a7561c178fd7e9f9d1fbd7dac3e3843fd1/addons/account/models/account_move.py#L896-L912 ↩↩↩↩

  3. https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler ↩