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

[FIX] expression: prevent an error when using a customized field in domain #164924

Draft
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

mega-odoo
Copy link
Contributor

@mega-odoo mega-odoo commented May 8, 2024

Currently, The issue is occurring because of customized field use in the domain.

Steps to reproduce:

  • Go to Settings > Technical > Database Structure > Fields.
  • And create a new field with Field Label: New Related Field, Model: Attachment, Field Type: Binary.
  • Go to Settings > Technical > User Interface > User Defined Filters.
  • Create a new filter with Model: Attachment, in the domain, select
    'New Related Field' that you have created with '=' operator, and right side of the domain as 'win'.
  • Then save it, the error will occur in the backend.

Error Message: Binary field 'Image 1024' stored in attachment: ignore image_1024 != '""'

This error message occurs during the use of customized fields in the Domain condition, And this error message is
not important. So replace a logger error message with a logger warning message at [1] to prevent more error log in terminal.

link [1]:

odoo/odoo/osv/expression.py

Lines 915 to 916 in 85ec121

_logger.error("Binary field '%s' stored in attachment: ignore %s %s %s",
field.string, left, operator, reprlib.repr(right))

sentry-4551348536

…omain

Currently, The issue is occurring because of customized field use in the domain.

Steps to reproduce:

- Go to Settings > Technical > Database Structure > Fields.
- And create a new field with Field Label: New Related Field, Model: Attachment,
Field Type: Binary.
- Go to Settings > Technical > User Interface > User Defined Filters.
- Create a new filter with Model: Attachment, in the domain, select
'New Related Field' that you have created with '=' operator, and right side
of the domain as 'win'.
- Then save it, the error will occur in the backend.

Error Message: Binary field 'Image 1024' stored in attachment: ignore
image_1024 != '""'

This error message occurs during the use of customized fields in the Domain
condition, And this error message is not important. So replace a logger error
message with a logger warning message at [1] to prevent this issue.

link [1]: https://github.com/odoo/odoo/blob/85ec121fa1838d6fca3caf3e4c82ec267615dd11/odoo/osv/expression.py#L915-L916

sentry-4551348536
@robodoo
Copy link
Contributor

robodoo commented May 8, 2024

Pull request status dashboard.

@C3POdoo C3POdoo added the RD research & development, internal work label May 8, 2024
@mega-odoo
Copy link
Contributor Author

Hello @odoo/sentry_reviewers

Please review this PR.

Thank You 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants