From 0eee7c68ff427a1c27cc265d56423d65b7e14c0f Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 9 Jul 2019 16:04:03 +0000 Subject: [PATCH] [FIX] payment: translated in frontend Same reason as: 4ba4d61903b Some messages from payment are displayed on the frontend (eg. when the transaction is being done on the ecommerce), but only translations of module matching a given domain (computed with the method of ir.http model: _get_translation_frontend_modules_domain) are made available on the frontend. With this changeset, payment is added in the domain (which can be done since payment depends on account, account on portal, and portal in http_routing that declares the method). opw-2033528 closes #34712 Signed-off-by: Nicolas Lempereur (nle) --- addons/payment/models/__init__.py | 1 + addons/payment/models/ir_http.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 addons/payment/models/ir_http.py diff --git a/addons/payment/models/__init__.py b/addons/payment/models/__init__.py index 93f5083aca8..8491af34960 100644 --- a/addons/payment/models/__init__.py +++ b/addons/payment/models/__init__.py @@ -5,4 +5,5 @@ from . import account_invoice from . import res_partner from . import account_payment from . import chart_template +from . import ir_http from . import res_company diff --git a/addons/payment/models/ir_http.py b/addons/payment/models/ir_http.py new file mode 100644 index 00000000000..0d9c9c8de32 --- /dev/null +++ b/addons/payment/models/ir_http.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models +from odoo.osv import expression + + +class IrHttp(models.AbstractModel): + _inherit = 'ir.http' + + @classmethod + def _get_translation_frontend_modules_domain(cls): + domain = super(IrHttp, cls)._get_translation_frontend_modules_domain() + return expression.OR([domain, [('name', '=', 'payment')]])