Skip to content

Conversation

@pilarvargas-tecnativa
Copy link
Contributor

@pilarvargas-tecnativa pilarvargas-tecnativa commented Nov 3, 2025

@Tecnativa TT58473

@carlos-lopez-tecnativa @carlosdauden please review

In this migration, the search function has been adapted to the current
product search function in any search engine on the website.

@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 18.0-mig-website_sale_barcode_search branch from 8645b92 to 4049cdb Compare November 3, 2025 10:57
@pedrobaeza
Copy link
Member

/ocabot migration website_sale_barcode_search

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Nov 3, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Nov 3, 2025
40 tasks
Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

When I tried to test and search, I got this error. Please review

image

I think this code needs to be adapted to use something like product_variant_ids.barcode.
https://github.com/odoo/odoo/blob/54f10b56f577ad9ed5575bd396dba7d20d22fc2e/addons/website_sale/models/product_template.py#L776

@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 18.0-mig-website_sale_barcode_search branch from 4049cdb to fec4edd Compare November 4, 2025 06:57
@pilarvargas-tecnativa
Copy link
Contributor Author

When I tried to test and search, I got this error. Please review

I don't replicate that error locally. It's a calculated field, but when there are no variants, the barcode goes in the product template. Otherwise, it's calculated from the variants, but as I said, I don't replicate it. I've pushed again to restart runboat in case it was a runbot error, and I haven't replicated it either.
My tests on a clean database are:

  • Search for a random code without setting a barcode for any product. The result is that it does not find any products, which is expected.
  • Set a barcode for a product template without variants and search. It finds the product.
  • In the previous template, delete the barcode and set it on the only variant. It finds the product.
  • Set barcodes on two variants of the same product. It finds the product.
  • Search for any other code and it finds nothing, as expected.

Is there a specific test where the error appears?

@carlos-lopez-tecnativa
Copy link
Contributor

When I tried to test and search, I got this error. Please review

I don't replicate that error locally. It's a calculated field, but when there are no variants, the barcode goes in the product template. Otherwise, it's calculated from the variants, but as I said, I don't replicate it. I've pushed again to restart runboat in case it was a runbot error, and I haven't replicated it either. My tests on a clean database are:

  • Search for a random code without setting a barcode for any product. The result is that it does not find any products, which is expected.
  • Set a barcode for a product template without variants and search. It finds the product.
  • In the previous template, delete the barcode and set it on the only variant. It finds the product.
  • Set barcodes on two variants of the same product. It finds the product.
  • Search for any other code and it finds nothing, as expected.

Is there a specific test where the error appears?

I just type any word in the search panel. I noticed that when I type more than three words, this error is raised. It’s weird, but you can reproduce it in Runboat. Looking deeper, I imagine this is related to PostgreSQL’s trigram index:
https://www.postgresql.org/docs/current/pgtrgm.html

website_sale_barcode_search.mp4

@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 18.0-mig-website_sale_barcode_search branch from fec4edd to e04bd2e Compare November 12, 2025 10:23
In this migration, the search function has been adapted to the current
product search function in any search engine on the website.

TT58473
Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants