From 80132ad9a61b99dbc35e31e7e440d1482d29c3e4 Mon Sep 17 00:00:00 2001 From: Hardik Prajapati Date: Tue, 27 Aug 2019 10:16:56 +0000 Subject: [PATCH 01/82] [FIX] account: 'Auto-Validate' entries are not linked to it's reconcile model 'Journal Entries' stat button on 'Configuration/Accounting/Reconciliation Models' do not consider entries which are automatically validated. closes odoo/odoo#36169 Task: 2056926 Signed-off-by: Quentin De Paoli (qdp) --- addons/account/models/account_reconcile_model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/account_reconcile_model.py b/addons/account/models/account_reconcile_model.py index 1788306b57c..624767875a7 100644 --- a/addons/account/models/account_reconcile_model.py +++ b/addons/account/models/account_reconcile_model.py @@ -222,6 +222,7 @@ class AccountReconcileModel(models.Model): 'analytic_tag_ids': [(6, 0, self.analytic_tag_ids.ids)], 'debit': line_balance > 0 and line_balance or 0, 'credit': line_balance < 0 and -line_balance or 0, + 'reconcile_model_id': self.id, } new_aml_dicts.append(writeoff_line) @@ -244,6 +245,7 @@ class AccountReconcileModel(models.Model): 'analytic_tag_ids': [(6, 0, self.second_analytic_tag_ids.ids)], 'debit': line_balance > 0 and line_balance or 0, 'credit': line_balance < 0 and -line_balance or 0, + 'reconcile_model_id': self.id, } new_aml_dicts.append(second_writeoff_line) From d3d21d2a64c4460c58022451baeba0f7e8cb9d8a Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 16 Sep 2019 13:39:12 +0000 Subject: [PATCH 02/82] [FIX] auth_signup: Not possible to send message in a task from the portal Steps to reproduce: - Let's consider the portal user Pu, the project Pr and the task Ta - Add Pu as a follower of Pr - Log as Pu and open Ta - Try to post a message Bug: An access error was raised due to the rule "res_partner: portal/public: read access on my commercial partner". opw:2070320 closes odoo/odoo#36960 Signed-off-by: Simon Goffin (sig) --- addons/auth_signup/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_signup/models/res_partner.py b/addons/auth_signup/models/res_partner.py index db66467d7dd..e0fbb6a34d2 100644 --- a/addons/auth_signup/models/res_partner.py +++ b/addons/auth_signup/models/res_partner.py @@ -109,7 +109,7 @@ class ResPartner(models.Model): allow_signup = self.env['res.users']._get_signup_invitation_scope() == 'b2c' for partner in self: - if allow_signup and not partner.user_ids: + if allow_signup and not partner.sudo().user_ids: partner = partner.sudo() partner.signup_prepare() res[partner.id]['auth_signup_token'] = partner.signup_token From 0d7ef88299678413d6ecc65ced4880c96d05f3dd Mon Sep 17 00:00:00 2001 From: Alex Tuyls Date: Tue, 17 Sep 2019 13:31:43 +0000 Subject: [PATCH 03/82] [FIX] event: allow ics file with public user If you register online on a free event, there is an access rights error when trying to download the ICS file if you are connectd with public user. `if not event` part is pointless, if event cannot be resolved, @http.route would return a 404 anyway. `if not event.registration_ids` does not make sense from a functional point of view: there is no problem in generating an .ics file for a public event that has no registrations (yet) and the button we use to generate the .ics file is displayed after the registration anyway. opw-2066847 closes odoo/odoo#37012 X-origin-commit: f4ca5897df9295b684bcbfcafd98fbde2f8bf673 Signed-off-by: Nicolas Martinelli (nim) --- addons/event/controllers/main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/event/controllers/main.py b/addons/event/controllers/main.py index f844e6a5d51..723d30aaa51 100644 --- a/addons/event/controllers/main.py +++ b/addons/event/controllers/main.py @@ -10,8 +10,6 @@ class EventController(Controller): @route(['''/event//ics'''], type='http', auth="public") def event_ics_file(self, event, **kwargs): - if not event or not event.registration_ids: - return request.not_found() files = event._get_ics_file() if not event.id in files: return NotFound() From 99e4b042e43c69b79ac6c71520a89c0172ca361b Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 16 Sep 2019 15:01:50 +0000 Subject: [PATCH 04/82] [FIX] payment, payment_stripe_sca: multiwebsite base_url Have a multiwebsite setup have stripe installed for one of the two websites Make an order on that website and try to pay with stripe Before this commit, the transaction doesn't come back to odoo's payment success controller This was because the return url was set to the web base url ICP After this commit, the payment success page is opened as we took the request's url as the return url OPW 2070428 closes odoo/odoo#37024 X-original-commit: 937b5c076e7175bec664ed0cf4b77505e342f1e2 Signed-off-by: Lucas Perais (lpe) --- addons/payment/models/payment_acquirer.py | 14 ++++++++++++++ addons/payment_stripe_sca/models/payment.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 46f04b6f3dc..18c603734e5 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -14,6 +14,7 @@ from odoo.exceptions import ValidationError from odoo import api, SUPERUSER_ID from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from odoo.tools.misc import formatLang +from odoo.http import request _logger = logging.getLogger(__name__) @@ -210,6 +211,19 @@ class PaymentAcquirer(models.Model): (_check_required_if_provider, 'Required fields not filled', []), ] + def get_base_url(self): + self.ensure_one() + # priority is always given to url_root + # from the request + url = '' + if request: + url = request.httprequest.url_root + + if not url and 'website_id' in self and self.website_id: + url = self.website_id._get_http_domain() + + return url or self.env['ir.config_parameter'].sudo().get_param('web.base.url') + def _get_feature_support(self): """Get advanced feature support by provider. diff --git a/addons/payment_stripe_sca/models/payment.py b/addons/payment_stripe_sca/models/payment.py index 890fdfe87d9..d1f4b142ed2 100644 --- a/addons/payment_stripe_sca/models/payment.py +++ b/addons/payment_stripe_sca/models/payment.py @@ -20,7 +20,7 @@ class PaymentAcquirerStripeSCA(models.Model): def stripe_form_generate_values(self, tx_values): self.ensure_one() - base_url = self.env["ir.config_parameter"].sudo().get_param("web.base.url") + base_url = self.get_base_url() stripe_session_data = { "payment_method_types[]": "card", "line_items[][amount]": int( From 3c867d7c95c526ccca5945b3a0e49fd96fa02510 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 17 Sep 2019 11:27:15 +0000 Subject: [PATCH 05/82] [FIX] website_sale: cart recovery email should display the right lines Before this commit, the cart recovery email displayed all lines of the order After this commit, the email only shows relevant lines, that is excluding deliveries for example OPW 2072814 closes odoo/odoo#37025 X-original-commit: 234c3f56f4c03281f068981cd5af6bc8f5956334 Signed-off-by: Lucas Perais (lpe) --- addons/website_sale/data/mail_template_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/data/mail_template_data.xml b/addons/website_sale/data/mail_template_data.xml index fd94cb52c82..60d6e754f80 100644 --- a/addons/website_sale/data/mail_template_data.xml +++ b/addons/website_sale/data/mail_template_data.xml @@ -38,7 +38,7 @@

THERE'S SOMETHING IN YOUR CART.

Would you like to complete your purchase?

% if object.order_line: - % for line in object.order_line: + % for line in object.website_order_line:
From d201802abe054195c2de7a3ecce8c1c3cf866f3d Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Wed, 14 Aug 2019 12:35:21 +0000 Subject: [PATCH 06/82] [FIX] web: prevent unwanted click on enter keypress Backport of 801c603218 Pressing ENTER on a button element triggers an additionnal 'click' event. Since this 'unwanted' click caused some issues in a few cases, we prevent it. Moreover, there isn't currently any known case in which this event is useful. Before this commit: No modification of the initial behaviour on ENTER key After this commit: ENTER key pressed in abstract fields has its default behaviour suppressed --- addons/web/static/src/js/fields/abstract_field.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js index 822c90c31f4..1d37dfcade5 100644 --- a/addons/web/static/src/js/fields/abstract_field.js +++ b/addons/web/static/src/js/fields/abstract_field.js @@ -523,6 +523,12 @@ var AbstractField = Widget.extend({ } break; case $.ui.keyCode.ENTER: + // We preventDefault the ENTER key because of two coexisting behaviours: + // - In HTML5, pressing ENTER on a