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

[FIX] website_sale, website_quote: display payment acquirers per country #24416

Merged
merged 1 commit into from Apr 27, 2018

Conversation

len-foss
Copy link
Contributor

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

@@ -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)])
Copy link
Contributor

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

@len-foss len-foss force-pushed the 11.0-opw1837819-webpayc-len branch from 7f503c6 to 69636ef Compare April 25, 2018 15:31
@@ -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])])
Copy link
Contributor

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])]
])

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
@len-foss len-foss force-pushed the 11.0-opw1837819-webpayc-len branch from 69636ef to 17d27a1 Compare April 26, 2018 10:14
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 26, 2018
@len-foss len-foss merged commit 0050019 into odoo:11.0 Apr 27, 2018
@len-foss len-foss deleted the 11.0-opw1837819-webpayc-len branch April 27, 2018 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants