From cd26062a38291563280746d9454f3562784d3198 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 13 Sep 2017 18:41:54 +0200 Subject: [PATCH 01/14] [FIX] mass_mailing: add missing statistics index Indexing `mail_mail_id_int` is useful for locating the statistics entry that should be updated (bounced/opened/replied) --- addons/mass_mailing/models/mass_mailing_stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mass_mailing/models/mass_mailing_stats.py b/addons/mass_mailing/models/mass_mailing_stats.py index e330975fe5f..cea7ee28a63 100644 --- a/addons/mass_mailing/models/mass_mailing_stats.py +++ b/addons/mass_mailing/models/mass_mailing_stats.py @@ -20,7 +20,8 @@ class MailMailStats(models.Model): string='Mail ID (tech)', help='ID of the related mail_mail. This field is an integer field because ' 'the related mail_mail can be deleted separately from its statistics. ' - 'However the ID is needed for several action and controllers.' + 'However the ID is needed for several action and controllers.', + index=True, ) message_id = fields.Char(string='Message-ID') model = fields.Char(string='Document model') From c5b9bdcf9f0bb41f0e65b0f96aeac89d544b3301 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 12 Sep 2017 15:41:11 +0200 Subject: [PATCH 02/14] [FIX] website_quote: images of acquirer should be dynamic Echoes commit c255342e8fa1902852b17f39bedccfb698471546 Before this commit, the image that was fetched for the quotes was the static one, preventing it to be changed Now, the image is dynamically fetched OPW 769701 closes #19417 --- addons/website_quote/views/website_quote_templates.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/website_quote/views/website_quote_templates.xml b/addons/website_quote/views/website_quote_templates.xml index 369ab2890ea..2aa63f2f730 100644 --- a/addons/website_quote/views/website_quote_templates.xml +++ b/addons/website_quote/views/website_quote_templates.xml @@ -340,9 +340,7 @@
  • From ecc75092776ca11089772a970fba9638071322d9 Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Thu, 14 Sep 2017 09:56:07 +0200 Subject: [PATCH 03/14] [FIX] account, invoice analysis: negative amounts for in_invoice-like Before this commit, the invoice analysis report summed the amount of invoices regardless of whether they were in or out, as if it were an absolute sum. This commit corrects the behavior back to v9's, where in_invoice have the minus sign and are hence subtracted opw 769409. Was PR #19413 --- addons/account/report/account_invoice_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index e76f25027ff..df6c4c5c2f8 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -114,7 +114,7 @@ class AccountInvoiceReport(models.Model): ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id, ai.partner_bank_id, SUM ((invoice_type.sign * ail.quantity) / u.factor * u2.factor) AS product_qty, - SUM(ail.price_subtotal_signed) AS price_total, + SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total, SUM(ABS(ail.price_subtotal_signed)) / CASE WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric THEN SUM(ail.quantity / u.factor * u2.factor) From 77566f5067ee56bab1ad7e697b7abe1b7745dcc4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 13 Sep 2017 16:44:18 +0200 Subject: [PATCH 04/14] [FIX] website_sale: Pay Now button is clickable even without clicking policies and conditions Steps to reproduce the bug: -Go to the shop -Add an item to card -Checkout -Insert address info -Click proceed -Enable "Accept Terms & Conditions" -With the HTML Editor, remove the attribute checked="checked" in template Accept Terms & Conditions Bug: -Pay Now button is clickable but the Policy and Procedures box was not checked. opw:771418 --- addons/website_sale/static/src/js/website_sale_payment.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index c4c4861654d..526145bba8d 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -6,9 +6,10 @@ var ajax = require('web.ajax'); $(document).ready(function () { // If option is enable if ($("#checkbox_cgv").length) { - $("#checkbox_cgv").click(function() { + var enabling_button = function() { $("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked); - }); + }; + $("#checkbox_cgv").click(enabling_button).each(enabling_button); } // When choosing an acquirer, display its Pay Now button From dc49b85493840a1e23e5ba42c8961098f24601cf Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 14 Sep 2017 11:11:03 +0200 Subject: [PATCH 05/14] [FIX] website_customer: add access rights for res.partner.industry List of industries is not a sensitive data, and public user need to have access right for sitemap. --- addons/website_customer/security/ir.model.access.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_customer/security/ir.model.access.csv b/addons/website_customer/security/ir.model.access.csv index 1615f7348a6..06d30ba469a 100644 --- a/addons/website_customer/security/ir.model.access.csv +++ b/addons/website_customer/security/ir.model.access.csv @@ -1,3 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink res_partner_tag_sale_manager,res.partner.tag.sale.manager,model_res_partner_tag,,1,0,0,0 -res_partner_tag_sale_manager_edition,res.partner.tag.sale.manager.edition,model_res_partner_tag,sales_team.group_sale_manager,1,1,1,1 \ No newline at end of file +res_partner_tag_sale_manager_edition,res.partner.tag.sale.manager.edition,model_res_partner_tag,sales_team.group_sale_manager,1,1,1,1 +res_partner_industry_all,res_partner_industry all,base.model_res_partner_industry,,1,0,0,0 From ce2d00f3467e616de2e75a445bb6f2cb76d30495 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 13 Sep 2017 15:22:42 +0200 Subject: [PATCH 06/14] [FIX] account: Register a payment with no sequence for account.payment When registring a supplier invoice, if no sequence exists for code "account.payment.supplier.invoice" then it failed for the creation of the counterpart lines because a name is required to create an account move line. ps: check function "_get_liquidity_move_line_vals" for the condition. opw:767224 --- addons/account/i18n/account.pot | 6 ++++++ addons/account/models/account_payment.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 0b7b1461634..81687316647 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -9674,6 +9674,12 @@ msgstr "" msgid "You have" msgstr "" +#. module: account +#: code:addons/account/models/account_payment.py:360 +#, python-format +msgid "You have to define a sequence for %s in your company." +msgstr "" + #. module: account #: code:addons/account/wizard/account_report_general_ledger.py:21 #, python-format diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 4a49bb3b5f9..fcc2dbd0319 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -356,6 +356,8 @@ class account_payment(models.Model): if rec.payment_type == 'outbound': sequence_code = 'account.payment.supplier.invoice' rec.name = self.env['ir.sequence'].with_context(ir_sequence_date=rec.payment_date).next_by_code(sequence_code) + if not rec.name and self.payment_type != 'transfer': + raise UserError(_("You have to define a sequence for %s in your company.") % (sequence_code,)) # Create the journal entry amount = rec.amount * (rec.payment_type in ('outbound', 'transfer') and 1 or -1) From 7de94268fc7f8f676de0f45a65dfc410676b73be Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Mon, 11 Sep 2017 15:20:56 +0200 Subject: [PATCH 07/14] [FIX] web: skip buttons when navigating in editable list Clicking on a cell that contains a button (but not ON the button) leads to a traceback (see "Scrap" button in Stock Operation for example). This is due to the fact that a button is not registered as a widget so it can't be activated. This commit ensures that the next line is selected if the last column is a buttton. --- .../js/views/list/list_editable_renderer.js | 3 ++ addons/web/static/tests/views/list_tests.js | 49 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js index 229c61733e5..7984ebf21e1 100644 --- a/addons/web/static/src/js/views/list/list_editable_renderer.js +++ b/addons/web/static/src/js/views/list/list_editable_renderer.js @@ -477,6 +477,9 @@ ListRenderer.include({ return this._selectRow(rowIndex).then(function () { var record = self.state.data[rowIndex]; var correctedIndex = colIndex - getNbButtonBefore(colIndex); + if (correctedIndex >= (self.allFieldWidgets[record.id] || []).length) { + return $.Deferred().reject(); + } var fieldIndex = self._activateFieldWidget(record, correctedIndex, { inc: 1, wrap: wrap, diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index ddb662a19e6..6f25cff4721 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -2273,6 +2273,55 @@ QUnit.module('Views', { list.destroy(); }); + QUnit.test('skip buttons when navigating list view with TAB (end)', function (assert) { + assert.expect(2); + + var list = createView({ + View: ListView, + model: 'foo', + data: this.data, + arch: '' + + '' + + '