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
[FIX] website_sale, website_quote: display payment acquirers per country #24416
Conversation
@@ -89,7 +89,7 @@ def view(self, order_id, pdf=None, token=None, message=False, **post): | |||
} | |||
|
|||
if order_sudo.require_payment or values['need_payment']: | |||
acquirers = request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', order_sudo.company_id.id)]) | |||
acquirers = request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', order_sudo.company_id.id), '|', ('specific_countries', '=', False), ('country_ids', '=', order_sudo.partner_id.country_id.id)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should use in
: ('country_ids', 'in', [order_sudo.partner_id.country_id.id])
e.g. https://github.com/odoo/odoo/blob/11.0/addons/mail/controllers/bus.py#L27
7f503c6
to
69636ef
Compare
@@ -89,7 +89,7 @@ def view(self, order_id, pdf=None, token=None, message=False, **post): | |||
} | |||
|
|||
if order_sudo.require_payment or values['need_payment']: | |||
acquirers = request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', order_sudo.company_id.id)]) | |||
acquirers = request.env['payment.acquirer'].sudo().search([('website_published', '=', True), ('company_id', '=', order_sudo.company_id.id), '|', ('specific_countries', '=', False), ('country_ids', 'in', [order_sudo.partner_id.country_id.id])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
domain = expression.AND([
['&', ('website_published', '=', True), ('company_id', '=', order_sudo.company_id.id)],
['|', ('specific_countries', '=', False), ('country_ids', 'in', [order_sudo.partner_id.country_id.id])]
])
69636ef
to
17d27a1
Compare
Commit 542201e added the possibility to configure a set of countries for a
given payment acquirer.
Commit 194d52e refactored the payment form, but forgot to take the country
into acount.
opw 1837819
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr