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

[18.0][MIG] res_company_code: Migration to 18.0 #752

Merged
merged 24 commits into from
Feb 21, 2025

Conversation

BhaveshHeliconia
Copy link

@BhaveshHeliconia BhaveshHeliconia commented Dec 26, 2024

legalsylvain and others added 23 commits December 26, 2024 16:53

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: multi-company-13.0/multi-company-13.0-res_company_code
Translate-URL: https://translation.odoo-community.org/projects/multi-company-13-0/multi-company-13-0-res_company_code/
Currently translated at 100.0% (5 of 5 strings)

Translation: multi-company-13.0/multi-company-13.0-res_company_code
Translate-URL: https://translation.odoo-community.org/projects/multi-company-13-0/multi-company-13-0-res_company_code/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: multi-company-14.0/multi-company-14.0-res_company_code
Translate-URL: https://translation.odoo-community.org/projects/multi-company-14-0/multi-company-14-0-res_company_code/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: multi-company-16.0/multi-company-16.0-res_company_code
Translate-URL: https://translation.odoo-community.org/projects/multi-company-16-0/multi-company-16-0-res_company_code/
Currently translated at 100.0% (5 of 5 strings)

Translation: multi-company-16.0/multi-company-16.0-res_company_code
Translate-URL: https://translation.odoo-community.org/projects/multi-company-16-0/multi-company-16-0-res_company_code/it/
@api.model
def name_search(self, name, args=None, operator="ilike", limit=100):
args = args or []
domain = []
if name:
domain = ["|", ("code", operator, name), ("name", operator, name)]
company = self.search(domain + args, limit=limit)
return company.name_get()
return company._search_display_name()
Copy link

Choose a reason for hiding this comment

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

_search_display_name has a different signature in the main Odoo codebase. Just move the one-liner here instead?

Copy link
Author

Choose a reason for hiding this comment

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

@amh-mw , Thank you for the suggestions! it's fixed can you rereview it?

if not company.code:
company.complete_name = company.name
else:
company.complete_name = f"{company.code} - {company.name}"
Copy link

Choose a reason for hiding this comment

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

I wonder if this couldn't become _compute_display_name instead and the complete_name field dropped entirely. Worth consideration, but perhaps outside the scope of this migration. LGTM.

Copy link
Author

Choose a reason for hiding this comment

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

@amh-mw , Thank you for the suggestions! it's fixed can you rereview it?

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-res_company_code branch from d11047b to d2a7a84 Compare January 24, 2025 06:14
Copy link

@amh-mw amh-mw left a comment

Choose a reason for hiding this comment

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

Code review only. LGTM.

@Christian-RB
Copy link
Contributor

Inside the test-requirements.txt file you should put the link to the PR involved with the next format, all in one line (Version >= 17):
odoo-addon-<module_name> @ git+https://github.com/OCA/<repository>.git@refs/pull/<PR_number>/head#subdirectory=<module_name>
For this case it should look like this:
odoo-addon-res_company_search_view @ git+https://github.com/OCA/multi-company.git@refs/pull/751/head#subdirectory=res_company_search_view

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-res_company_code branch from 7d3ca64 to 03eedb4 Compare January 29, 2025 11:01
@BhaveshHeliconia
Copy link
Author

@Christian-RB ,
I followed the correct format and added it to the test-requirements.txt, but it's still not working. Could you suggest any solutions or troubleshooting steps?

@Christian-RB
Copy link
Contributor

@HeliconiaSolutions Check that the pre-commit is trying to edit the new file, maybe that's the reason

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-res_company_code branch from 03eedb4 to 4c0e8b0 Compare February 5, 2025 07:39
@BhaveshHeliconia
Copy link
Author

@Christian-RB, I fixed the pre-commit issues and pushed my changes, but the pipeline is still failing in one case. Am I missing something? Could you guide me?

Thank you in advance!

@Christian-RB
Copy link
Contributor

Everything is perfect now, @HeliconiaSolutions! The runboat has been created, and tests are passing. The only failing test is due to the pending dependency itself. Once the dependency is merged, you should remove the [DONT MERGE] commit, rebase and everything should turn green. Thank you

Copy link

@amh-mw amh-mw left a comment

Choose a reason for hiding this comment

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

Code review only. LGTM.

Copy link
Contributor

@Christian-RB Christian-RB left a comment

Choose a reason for hiding this comment

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

LGTM

@BhaveshHeliconia
Copy link
Author

@legalsylvain, Can you please proceed with merging this PR?

@legalsylvain
Copy link
Contributor

/ocabot migration res_company_code

@legalsylvain, Can you please proceed with merging this PR?

no. waiting for #751

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Feb 20, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 20, 2025
10 tasks
@BhaveshHeliconia
Copy link
Author

@legalsylvain , #751 has been merged. Could you take a look now?

@legalsylvain
Copy link
Contributor

CI is red, because you should remove fe3745d now.

thanks !

@BhaveshHeliconia BhaveshHeliconia force-pushed the 18.0-mig-res_company_code branch from fe3745d to 5943203 Compare February 21, 2025 09:15
@BhaveshHeliconia
Copy link
Author

@legalsylvain, I've removed fe3745d, and the CI is green now. Please review. Thanks!

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@legalsylvain
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-752-by-legalsylvain-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit 361adf2 into OCA:18.0 Feb 21, 2025
7 checks passed
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.

None yet