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

[17.0][FIX] account_payment_mode: error when payment mode #1312

Merged

Conversation

imlopes
Copy link

@imlopes imlopes commented Jul 8, 2024

When installing account_payment_mode and a provider together, we have an error linked to a duplicate payment method :

  File "/odoo/src/addons/account/models/account_payment_method.py", line 141, in _ensure_unique_name_for_journal
    self.journal_id._check_payment_method_line_ids_multiplicity()
  File "/odoo/src/addons/account/models/account_journal.py", line 540, in _check_payment_method_line_ids_multiplicity
    raise ValidationError(_(
odoo.exceptions.ValidationError: Some payment methods supposed to be unique already exists somewhere else.
(Stripe)

#977

This error is linked to account_payment_mode and it was considered fixed here: #1093 but the problem is still there: #1283

But now odoo is checking by account.payment.method mode unique or electronic, so both need to be "unique".

odoo/odoo@d07a696

So here I'm adapting the code to follow this logic.

I've found this PR for v16.0 (#1298) and I really don't know the best solution.

@pedrobaeza pedrobaeza added this to the 17.0 milestone Jul 8, 2024
@pedrobaeza
Copy link
Member

Please give more context.

@imlopes
Copy link
Author

imlopes commented Jul 8, 2024

Please give more context.

Hello @pedrobaeza
I've updated the description for this PR.

Thanks

@imlopes imlopes marked this pull request as ready for review July 8, 2024 18:10
Copy link

@yankinmax yankinmax left a comment

Choose a reason for hiding this comment

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

LGTM code review

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

@imlopes imlopes force-pushed the fix-bank-payment-eletronic-provider-error branch from a5122db to a5d70d6 Compare July 29, 2024 13:30
@imlopes imlopes force-pushed the fix-bank-payment-eletronic-provider-error branch from a5d70d6 to 68de5e5 Compare July 29, 2024 14:47
@imlopes imlopes requested a review from pedrobaeza July 29, 2024 14:48
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-1312-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e80ca81 into OCA:17.0 Jul 29, 2024
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

5 participants