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

[IMP] partner_(ref,vat)_unique: enable name search by the VAT Identification Number and Reference #1691

Merged

Conversation

CLaurelB
Copy link

@CLaurelB CLaurelB commented Mar 6, 2024

The search functionality has been improved to include the VAT
Identification Number and Partner Reference. This enhancement
is achieved by inheriting the _name_search method to include
the VAT Identification Number and Partner Reference in the
search domain.

Additionally, tests have been added for this new inheritance.

@CLaurelB
Copy link
Author

CLaurelB commented Mar 6, 2024

@luisg123v could you review, please?

Copy link

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

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

Same comments left on OCA/project#1246

partner_ref_unique/tests/test_res_partner_ref.py Outdated Show resolved Hide resolved
@luisg123v
Copy link

PR title:

partner_(ref,vat)_unique

@CLaurelB CLaurelB changed the title [IMP] *: enable name search by the VAT Identification Number and Reference [IMP] partner_(ref,vat)_unique: enable name search by the VAT Identification Number and Reference Mar 8, 2024
@CLaurelB CLaurelB force-pushed the 15.0-add_name_search_by_ref_and_vat-CLaurelB branch 2 times, most recently from 2836ccc to c978f3c Compare March 8, 2024 21:02
@CLaurelB CLaurelB requested a review from luisg123v March 11, 2024 22:37
Copy link

@luisg123v luisg123v left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Hi @moylop260,

Could you review/merge, please?

Regards,

@CLaurelB CLaurelB force-pushed the 15.0-add_name_search_by_ref_and_vat-CLaurelB branch 3 times, most recently from 03efe4c to 6ec69cd Compare March 12, 2024 18:37
@CLaurelB
Copy link
Author

Hello @pedrobaeza @yajo

Could you review, please?

Regards.
cc. @moylop260 @luisg123v

@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). 🤖

@moylop260
Copy link

@yajo

Could you help me here too, please Tio?

@api.model
def _name_search(self, name="", args=None, operator="ilike", limit=100):
"""Allow searching by ref by default."""
if name and operator in ["=", "ilike", "=ilike", "like", "=like"]:
Copy link
Member

Choose a reason for hiding this comment

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

This is faster:

Suggested change
if name and operator in ["=", "ilike", "=ilike", "like", "=like"]:
if name and operator in {"=", "ilike", "=ilike", "like", "=like"}:

Copy link
Author

Choose a reason for hiding this comment

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

suggested change applied.

partner_vat_unique/models/res_partner.py Outdated Show resolved Hide resolved
The search functionality has been improved to include the Partner
Reference. This enhancement is achieved by inheriting the _name_search
method to include the Partner Reference in the search domain.

Additionally, tests have been added for this new inheritance.
…n Number

The search functionality has been improved to include the VAT
Identification Number. This enhancement is achieved by inheriting the
_name_search method to include the VAT Identification Number in the
search domain.

Additionally, tests have been added for this new inheritance.
Since the class SavepointCase has been merged into TransactionCase, it
has been replaced in the module tests.
@CLaurelB CLaurelB force-pushed the 15.0-add_name_search_by_ref_and_vat-CLaurelB branch from 6ec69cd to e753209 Compare March 13, 2024 14:19
@CLaurelB CLaurelB requested a review from yajo March 13, 2024 14:24
@moylop260
Copy link

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-1691-by-moylop260-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e621c4f into OCA:15.0 Mar 13, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

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.

6 participants