Skip to content

[17.0][MIG] base_name_search_improved: Migration to 17.0 #2831

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

Open
wants to merge 74 commits into
base: 17.0
Choose a base branch
from

Conversation

rov-adhoc
Copy link
Contributor

No description provided.

@thomaspaulb
Copy link

Same comment as in #2833: any idea why _search_smart_search doesn't seem to receive coverage?

@Bart-dh
Copy link

Bart-dh commented May 29, 2024

Hi! I was wondering - is there still ongoing work on this? Does it work functionally?

@rov-adhoc
Copy link
Contributor Author

@thomaspaulb Hey! I really I don't know how to solve the problem of coverage because it is working fine in my computer

@thomaspaulb
Copy link

@thomaspaulb Hey! I really I don't know how to solve the problem of coverage because it is working fine in my computer

https://en.wikipedia.org/wiki/Code_coverage

@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch 2 times, most recently from cb2c6b5 to bd3b119 Compare May 30, 2024 15:08
@rov-adhoc
Copy link
Contributor Author

@thomaspaulb Hey! thanks! Now it should be correct

Regards

@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch from bd3b119 to dc1e352 Compare July 2, 2024 11:28
@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch from dc1e352 to 2f4c3cc Compare July 3, 2024 17:12
@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch from 2f4c3cc to a91048f Compare July 4, 2024 10:43
@StefanRijnhart
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-2831-by-StefanRijnhart-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jul 4, 2024
Signed-off-by StefanRijnhart
@OCA-git-bot
Copy link
Contributor

@StefanRijnhart The merge process could not be finalized, because command oca-gen-addon-readme --if-source-changed --org-name OCA --repo-name server-tools --branch 17.0 --addons-dir /tmp/tmp5uc11ybe --commit failed with output:

/tmp/tmp5uc11ybe/base_name_search_improved/README.rst:87: (ERROR/3) Duplicate substitution definition name: "image1".
Traceback (most recent call last):
  File "/usr/local/bin/oca-gen-addon-readme", line 11, in <module>
    load_entry_point('oca-maintainers-tools', 'console_scripts', 'oca-gen-addon-readme')()
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/ocamt/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/ocamt/src/oca-maintainers-tools/tools/gen_addon_readme.py", line 575, in gen_addon_readme
    check_rst(readme_filename)
  File "/ocamt/src/oca-maintainers-tools/tools/gen_addon_readme.py", line 398, in check_rst
    publish_file(
  File "/ocamt/lib/python3.8/site-packages/docutils/core.py", line 422, in publish_file
    output, publisher = publish_programmatically(
  File "/ocamt/lib/python3.8/site-packages/docutils/core.py", line 722, in publish_programmatically
    output = publisher.publish(enable_exit_status=enable_exit_status)
  File "/ocamt/lib/python3.8/site-packages/docutils/core.py", line 234, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/ocamt/lib/python3.8/site-packages/docutils/readers/__init__.py", line 70, in read
    self.parse()
  File "/ocamt/lib/python3.8/site-packages/docutils/readers/__init__.py", line 76, in parse
    self.parser.parse(self.input, document)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/__init__.py", line 184, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 169, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 3024, in text
    self.section(title.lstrip(), source, style, lineno + 1, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2785, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 325, in section
    self.new_subsection(title, lineno, messages)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 391, in new_subsection
    newabsoffset = self.nested_parse(
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 279, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 233, in run
    context, next_state, result = self.check_line(
  File "/ocamt/lib/python3.8/site-packages/docutils/statemachine.py", line 445, in check_line
    return method(match, context, next_state)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2355, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2367, in explicit_construct
    return method(self, expmatch)
  File "/ocamt/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2085, in substitution_def
    self.document.note_substitution_def(
  File "/ocamt/lib/python3.8/site-packages/docutils/nodes.py", line 1550, in note_substitution_def
    msg = self.reporter.error(
  File "/ocamt/lib/python3.8/site-packages/docutils/utils/__init__.py", line 231, in error
    return self.system_message(self.ERROR_LEVEL, *args, **kwargs)
  File "/ocamt/lib/python3.8/site-packages/docutils/utils/__init__.py", line 197, in system_message
    raise SystemMessage(msg, level)
docutils.utils.SystemMessage: /tmp/tmp5uc11ybe/base_name_search_improved/README.rst:87: (ERROR/3) Duplicate substitution definition name: "image1".

@StefanRijnhart
Copy link
Member

Huh, looks like the README compilation is struggling with three images in two snippets. Can you play around to see if you can get it to work?

@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch from a91048f to 6e1e404 Compare July 4, 2024 15:46
@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch from 6e1e404 to bbbaff8 Compare July 10, 2024 12:10
@StefanRijnhart
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-2831-by-StefanRijnhart-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jul 10, 2024
Signed-off-by StefanRijnhart
mymage and others added 8 commits October 23, 2024 11:43
Currently translated at 36.0% (9 of 25 strings)

Translation: server-tools-16.0/server-tools-16.0-base_name_search_improved
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_name_search_improved/it/
Currently translated at 36.0% (9 of 25 strings)

Translation: server-tools-16.0/server-tools-16.0-base_name_search_improved
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_name_search_improved/it/
Currently translated at 100.0% (25 of 25 strings)

Translation: server-tools-16.0/server-tools-16.0-base_name_search_improved
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_name_search_improved/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-tools-16.0/server-tools-16.0-base_name_search_improved
Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-base_name_search_improved/
When applying monkey patches, we want to skip abstract models because patching
those may mess up the inheritance. An example of this is ir.model which is
assigned the studio mixin using inherit = ['studio.mixin', 'ir.model'].
If the mixin itself is patched, and the method is overridden once again (in,
say, enterprise 15's documents_spreadsheet), the super() method called in that
override is the patched version of studio.mixin rather than the override of
ir.model in the base module, which is now skipped entirely.
@rov-adhoc rov-adhoc force-pushed the 17.0-mig-base_name_search_improved branch from 441e0e2 to f1b908b Compare October 23, 2024 14:46
@rov-adhoc
Copy link
Contributor Author

@StefanRijnhart Hey please disregard my previous message. I've tried to implement what you requested, but it didn't work properly. I added the translation in the smart_search field to false. I hope this solves the merge problem.

@rov-adhoc
Copy link
Contributor Author

@StefanRijnhart HI! Just a friendly reminder 😊

@rov-adhoc
Copy link
Contributor Author

@StefanRijnhart Hi! I would like to ask you if you can check if its now ok
regards

@hbrunn
Copy link
Member

hbrunn commented Nov 20, 2024

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-2831-by-hbrunn-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 20, 2024
Signed-off-by hbrunn
# TODO perhaps better to create only the field when enabled on the model
smart_search = fields.Char(
compute="_compute_smart_search", search="_search_smart_search", translate=False
)
Copy link
Member

Choose a reason for hiding this comment

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

@rov-adhoc how did you try to implement @StefanRijnhart's suggestion? I'd expect it to work to override _setup_fields, check via sql if the model has the functionality enabled, and if so, add the field to self._fields.

Just setting translate to False can't work because it's not about the translations of data from the field, but about things like its label.

@OCA-git-bot
Copy link
Contributor

@hbrunn your merge command was aborted due to failed check(s), which you can inspect on this commit of 17.0-ocabot-merge-pr-2831-by-hbrunn-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@dreispt
Copy link
Member

dreispt commented Mar 16, 2025

/ocabot migration base_name_search_improved
/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-2831-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Mar 16, 2025
OCA-git-bot added a commit that referenced this pull request Mar 16, 2025
Signed-off-by dreispt
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 16, 2025
36 tasks
@OCA-git-bot
Copy link
Contributor

@dreispt your merge command was aborted due to failed check(s), which you can inspect on this commit of 17.0-ocabot-merge-pr-2831-by-dreispt-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

def patch_name_search():
@api.model
def _name_search(
self, name="", domain=None, operator="ilike", limit=100, order=None

Choose a reason for hiding this comment

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

The signature is incorrect, especially limit=100 gives incorrect results with domains like [("parent_id", "ilike", ...)])

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.