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

[16.0][FIX] date_range: Allow select date_ranges on custom filters #717

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

CarlosRoca13
Copy link
Contributor

This commit solves the problems reported on Issue #597

cc @Tecnativa TT43442

ping @pedrobaeza @sergio-teruel

@OCA-git-bot
Copy link
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@CarlosRoca13 CarlosRoca13 changed the title [FIX] date_range: Allow select date_ranges on custom filters [16.0][FIX] date_range: Allow select date_ranges on custom filters Sep 4, 2023
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2021 Studio73 - Pablo Fuentes (https://www.studio73.es)
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). -->
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CarlosRoca13 This addon is lgpl. Can you remove this change plz?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups! Sorry, change done!

This commit solves the problems reported on Issue OCA#597
Copy link
Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code + Functional

@lmignon
Copy link
Contributor

lmignon commented Sep 4, 2023

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-717-by-lmignon-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 15ec436 into OCA:16.0 Sep 4, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at ea46ce5. Thanks a lot for contributing to OCA. ❤️

@alexis-via
Copy link
Contributor

I just discovered that this PR causes a regression: when you use Odoo in French (the bug doesn't happen when you use Odoo in English), go to "Invoicing > Accounting > Journal Items" et click on "Filters" drop down menu ; you get this crash:

OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
    OwlError@http://localhost:8069/web/assets/debug/web.assets_common.js:16481:5 (/web/static/lib/owl/owl.js:87)
    handleError@http://localhost:8069/web/assets/debug/web.assets_common.js:17973:35 (/web/static/lib/owl/owl.js:1579)
    handleError@http://localhost:8069/web/assets/debug/web.assets_common.js:22184:20 (/web/static/lib/owl/owl.js:5790)
    _render@http://localhost:8069/web/assets/debug/web.assets_common.js:18119:30 (/web/static/lib/owl/owl.js:1725)
    render@http://localhost:8069/web/assets/debug/web.assets_common.js:18108:18 (/web/static/lib/owl/owl.js:1714)
    render@http://localhost:8069/web/assets/debug/web.assets_common.js:18819:23 (/web/static/lib/owl/owl.js:2425)

Caused by: TypeError: this.OPERATORS[FIELD_TYPES[type]] is undefined
    setDefaultValue@http://localhost:8069/web/assets/debug/web.assets_backend.js:175050:26 (/date_range/static/src/js/date_range.esm.js:47)
    setDefaultValue (patch date_range.CustomFilterItem)@http://localhost:8069/web/assets/debug/web.assets_backend.js:17461:44 (/web/static/src/core/utils/patch.js:96)
    addNewCondition@http://localhost:8069/web/assets/debug/web.assets_backend.js:19683:14 (/web/static/src/search/filter_menu/custom_filter_item.js:156)
    setup@http://localhost:8069/web/assets/debug/web.assets_backend.js:19662:14 (/web/static/src/search/filter_menu/custom_filter_item.js:135)
    setup@http://localhost:8069/web/assets/debug/web.assets_backend.js:175015:14 (/date_range/static/src/js/date_range.esm.js:12)
    setup (patch date_range.CustomFilterItem)@http://localhost:8069/web/assets/debug/web.assets_backend.js:17461:44 (/web/static/src/core/utils/patch.js:96)
    ComponentNode@http://localhost:8069/web/assets/debug/web.assets_common.js:18750:28 (/web/static/lib/owl/owl.js:2356)
    createComponent/<@http://localhost:8069/web/assets/debug/web.assets_common.js:22175:28 (/web/static/lib/owl/owl.js:5781)
    slot2@http://localhost:8069/web/assets/debug/web.assets_common.js line 21941 > Function:65:11 (/web/static/lib/owl/owl.js:5547)
    callSlot@http://localhost:8069/web/assets/debug/web.assets_common.js:19362:37 (/web/static/lib/owl/owl.js:2968)
    template@http://localhost:8069/web/assets/debug/web.assets_common.js line 21941 > Function:33:26 (/web/static/lib/owl/owl.js:5547)
    _render@http://localhost:8069/web/assets/debug/web.assets_common.js:18116:38 (/web/static/lib/owl/owl.js:1722)
    render@http://localhost:8069/web/assets/debug/web.assets_common.js:18108:18 (/web/static/lib/owl/owl.js:1714)
    render@http://localhost:8069/web/assets/debug/web.assets_common.js:18819:23 (/web/static/lib/owl/owl.js:2425)

If I checkout the code just before this PR was merged, then I don't have any crash when I click on "Filters" in the search view of account.move.line.

@alexis-via
Copy link
Contributor

The crash also happens when using Odoo in spanish (es). But I doesn't happen when using Odoo in Portuguese (pt).
I had a look at date_range/i18n/fr.po (and fr_FR.po), and I didn't see anything that could explain the bug.

@alexis-via
Copy link
Contributor

It is easy to reproduce the bug on runboat v16 of OCA/server-ux:

  1. activate the es language and switch to that language
  2. go to Facturation/Contabilidad > Contabilidad > Apuntes contables
  3. click on the "Filters" drop down menu

@alexis-via
Copy link
Contributor

If I overwrite fr.po and fr_FR.po with date_range.pot and I create a new v16 DB with account, date_range and account_usability, I still have the crash. So it seems that the content of the PO file is not the cause of the bug. But I can't explain why it crashes on es and fr, and not on pt !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants