Skip to content
Snippets Groups Projects
  1. Oct 17, 2019
    • Xavier-Do's avatar
      [IMP] base: avoid invalidate cache on first assets · fbfae7ef
      Xavier-Do authored
      
      Assets bundle creation will try to find previous version of assets and unlink them.
      This needs to invalidate ormcache to notify other workers.
      
      Since assets are never commited during test, assets will be generate at each request if request is
      not commited (cursor closed) whtch is the case with 404.
      
      Invalidating the orm cache only when a previous attachement was existing will help to
      mitigate the problem, and slightly improve HTTPCases test speed.
      
      closes odoo/odoo#38979
      
      X-original-commit: d4d63549
      Signed-off-by: default avatarXavier Dollé (xdo) <xdo@odoo.com>
      fbfae7ef
    • Xavier-Do's avatar
      [FIX] web: avoid expensive 404 during js tests · d65fcfec
      Xavier-Do authored
      A 404 will take 3 to 5 seconds to be resolved and execute +- 1900 query, to return
      a rendered page which is quite expensive, especially when multiple missing images
      are rendered in a view.
      
      Catching static route and marking them as not frontend will help to avoid to handle miss
      on static resources. In this case server returns a standard 404.
      
      This commit also fix a iframe src in order to avoid a 404 on
      /web/(test )/report/html/some_report (thx to aab-odoo)
      
      X-original-commit: 818d0cb5
      d65fcfec
  2. Oct 18, 2019
  3. Oct 17, 2019
  4. Oct 18, 2019
  5. Oct 17, 2019
  6. Oct 16, 2019
    • Debauche Stéphane's avatar
      [IMP] web: many2many_binary, binary, image, add the option ``accepted_file_extensions`` · e981e331
      Debauche Stéphane authored
      
      Purpose
      =======
      We want to add an option on the widgets
      - many2many_binary,
      - binary,
      - image
      
      This option specifies what file extensions the user can pick from the file input dialog box.
      
      Examples
      ========
      ```xml
      <field widget="many2many_binary" options="{'accepted_file_extensions': 'image/*'}"/>
      <field widget="many2many_binary" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
      <field widget="many2many_binary" options="{'accepted_file_extensions': 'application/pdf'}"/>
      <field widget="image" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
      <field widget="binary" options="{'accepted_file_extensions': '.pdf,.svg'}"/>
      ```
      
      How
      ===
      Add an option (accepted_file_extensions) in the template ``HiddenInputFile`` (the widget many2many_binary is using this template)
      So, we can also use this new option in others widgets using ``HiddenInputFile``
      In the many2many_binary, read the ``nodeOptions`` and set the widget attribute ``accepted_file_extensions``
      
      We also have to fix some other widget, because an property ``image_only`` was already existing in the template ``HiddenInputFile``
      (we just need to replace ``image_only=True`` to ``accepted_file_extensions='image/*'``
      
      The widget ``FieldPdfViewer`` (pdf_viewer) now use the new option to filtrate PDF
      (instead of removing the <input/> and adding <input accept='.pdf'/>).
      
      Tests
      =====
      We also test if the option is correctly set on the <input/>
      - binary
      - image
      - many2many_binary
      
      Impacted widgets
      ===============
      - many2many_binary
      - image: this widget use ``options="{accepted_file_extensions='image/*'}"`` instead of ``image_only=True``
      - tablet_image: same as ``image``
      
      Task #2082815
      
      closes odoo/odoo#38351
      
      Signed-off-by: default avatarVincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
      e981e331
  7. Oct 17, 2019
  8. Oct 16, 2019
  9. Oct 17, 2019
    • Odoo's Mergebot's avatar
      [FW][FIX] web: Correctly aggregate values in exported parent groups · 75759d31
      Odoo's Mergebot authored
      
      [FIX] web: Correctly aggregate values in exported parent groups
      --------------------
      When exporting a grouped list view with some nested groups, the aggregate value
      of parent groups are not correct. It always sums aggregated values of children
      whether the group operator is 'sum' or not (could be 'max', 'avg', ...).
      
      This behavior is wrong and can even lead to a crash if the aggregated field is a
      date field (e.g. with group_operator='max'). (Try two sum two dates...)
      
      To avoid the crash a quick fix was merged 85cf47fc just before OXP. This fix
      limited the support of aggregates to only int and float fields.
      This commit remove this limitation.
      
      This commit correctly implements the aggregation for parent group for all
      field types and all group_operator.
      
      This commit also improves the export feature tests.
      
      [FIX] base export: Manage False in groupby title
      --------------------
      Before this commit, when we export a list with a groupby on
      boolean, the groupby title 'False' is replaced by 'Undefined'
      in xls document.
      
      After this commit, with an export and groupby on a boolean, we
      will have correct title: True and False.
      
      --
      I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
      
      closes odoo/odoo#38896
      
      Forward-port-of: odoo/odoo#38373
      Signed-off-by: default avatarlul-odoo <LucasLefevre@users.noreply.github.com>
      Unverified
      75759d31
  10. Oct 16, 2019
Loading