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

[16.0] Replace partner_address_two_lines by partner_display_name_line_break #1546

Merged

Conversation

JuMiSanAr
Copy link
Contributor

@JuMiSanAr JuMiSanAr commented Jun 22, 2023

Fix the separation in two lines, and add tests.

Depends on: odoo/odoo#126451

@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from 1a5bd58 to 1ecd936 Compare June 22, 2023 09:50
@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from 1ecd936 to 5f14134 Compare June 26, 2023 09:26
Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

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

For the test, please focus on writing a "unit" test by calling name_get on different partners structures. We just want to make sure we get a \n instead of a , and that we don't get the separator and the contact type in case there's no contact name.

partner_address_two_lines/models/res_partner.py Outdated Show resolved Hide resolved
partner_address_two_lines/__manifest__.py Outdated Show resolved Hide resolved
partner_address_two_lines/models/res_partner.py Outdated Show resolved Hide resolved
@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from 5f14134 to beba215 Compare June 26, 2023 13:50
@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch 2 times, most recently from 7999f3b to eff6598 Compare June 26, 2023 15:29
@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from eff6598 to a137b89 Compare June 26, 2023 15:41
Copy link
Member

@mmequignon mmequignon left a comment

Choose a reason for hiding this comment

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

would be nice to have a screenshot or smth…
LG tough.

partner_address_two_lines/models/res_partner.py Outdated Show resolved Hide resolved
@rousseldenis rousseldenis added this to the 16.0 milestone Jun 30, 2023
Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

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

We have to change the module name please! 🙏🏼 😄 ❤️

It's really confusing :-(

The module make this:

imagen

@rafaelbn
Copy link
Member

@rousseldenis which name in your head?

name = self.child_partner_name.with_context(
_two_lines_partner_address=True
)._get_name()
self.assertEqual(name, "Test Company Name\n Test Partner Name")
Copy link
Contributor

Choose a reason for hiding this comment

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

Leave out the blank after \n . Same goes for the invoice address.

The improved code does not add a space at the beginning of the second line, which in my opinion is correct. The old code did however.

@trisdoan
Copy link

trisdoan commented Mar 9, 2024

Hi @rafaelbn, do you still want to rename the module

I am migrating it to 17.0. I can rename it as a part of the migration

@rafaelbn
Copy link
Member

@NL66278 @JuMiSanAr is this still need fixing PR?

Any idea with module name @hbrunn ?

partner_display_name_break_line ?

Thank you! 😄

Remember @trisdoan , this PR depends in a Odoo/odoo PR too

@rafaelbn
Copy link
Member

/ocabot rebase

@OCA-git-bot
Copy link
Contributor

@rafaelbn The rebase process failed, because command git push --force camptocamp tmp-pr-1546:16.0--partner_address_two_lines--fix failed with output:

remote: Permission to camptocamp/partner-contact.git denied to OCA-git-bot.
fatal: unable to access 'https://github.com/camptocamp/partner-contact/': The requested URL returned error: 403

@NL66278
Copy link
Contributor

NL66278 commented Apr 23, 2024

@rafaelbn My comment on how to fix the failing test has not been taken up after half a year. The prerequisite Odoo PR has a merge conflict that is also not resolved. If nothing is done on these issues I would propose closing the PR.

@JuMiSanAr
Copy link
Contributor Author

JuMiSanAr commented Apr 23, 2024

Test updated. Regarding the module name, I'm open to suggestions.

@rafaelbn
Copy link
Member

@NL66278 right! Test are fixed now! 🥳

@NL66278
Copy link
Contributor

NL66278 commented Apr 24, 2024

@JuMiSanAr I have two more request for approval and merge:

  • Squash your commits, so we are left with one commit;
  • Rename the module to partner_display_name_line_break;

Nearly the same as the module name proposed by @rafaelbn , but I think "line break" is the recognized term for this.

@rafaelbn
Copy link
Member

rafaelbn commented Apr 24, 2024 via email

@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from 675e239 to 7a536e8 Compare April 24, 2024 08:23
@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from 7a536e8 to b111a99 Compare April 24, 2024 08:26
@JuMiSanAr JuMiSanAr force-pushed the 16.0--partner_address_two_lines--fix branch from b111a99 to 9e43456 Compare April 24, 2024 08:29
@JuMiSanAr
Copy link
Contributor Author

@JuMiSanAr I have two more request for approval and merge:

  • Squash your commits, so we are left with one commit;
  • Rename the module to partner_display_name_line_break;

Nearly the same as the module name proposed by @rafaelbn , but I think "line break" is the recognized term for this.

There you go ☺️

Copy link
Contributor

@NL66278 NL66278 left a comment

Choose a reason for hiding this comment

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

👍 LGTM. Thanks for your contribution. Two questions, not breaking::

  • Why the dependency on context key? If this module is installed, apparently the instance administrators want to display the name and the company on two lines.
  • Does this really depend on the Odoo PR? If the Odoo PR is not accepted or merged, you will also get possibly the word 'Invoice' or one of the other type descriptions on a separate line. To me this seems to be consistent with the partner name on a second line.

@JuMiSanAr JuMiSanAr changed the title [16.0] partner_address_two_lines: fix display [16.0] Replace partner_address_two_lines by partner_display_name_line_break Apr 24, 2024
Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

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

Thank you! 👍🏼

NL66278 approved these changes

👍 LGTM. Thanks for your contribution. Two questions, not breaking::

  • Why the dependency on context key? If this module is installed, apparently the instance administrators want to display the name and the company on two lines.
  • Does this really depend on the Odoo PR? If the Odoo PR is not accepted or merged, you will also get possibly the word 'Invoice' or one of the other type descriptions on a separate line. To me this seems to be consistent with the partner name on a second line.

@trisdoan
Copy link

Hello @@JuMiSanAr, LGTM.

I agree with NL66278 that it does not need to depend on that PR

@NL66278
Copy link
Contributor

NL66278 commented Apr 29, 2024

/ocabot merge minor

OCA-git-bot added a commit that referenced this pull request Apr 29, 2024
Signed-off-by NL66278
@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-1546-by-NL66278-bump-minor, awaiting test results.

@OCA-git-bot
Copy link
Contributor

@NL66278 your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-1546-by-NL66278-bump-minor.

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.

@hbrunn
Copy link
Member

hbrunn commented May 6, 2024

please also add a PR to https://github.com/OCA/OpenUpgrade/blob/16.0/openupgrade_scripts/apriori.py#L6 to document the renaming for openupgrade.

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-1546-by-hbrunn-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit abf23e2 into OCA:16.0 May 6, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 1ccae3b. 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.

10 participants