diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index bca650dcc65..148eb56dce8 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -552,7 +552,10 @@ class AccountInvoice(models.Model): """ self.ensure_one() self.sent = True - return self.env.ref('account.account_invoices').report_action(self) + if self.user_has_groups('account.group_account_invoice'): + return self.env.ref('account.account_invoices').report_action(self) + else: + return self.env.ref('account.account_invoices_without_payment').report_action(self) @api.multi def action_invoice_sent(self): diff --git a/addons/account/views/account_report.xml b/addons/account/views/account_report.xml index 2ba116e884a..8918d2763e7 100644 --- a/addons/account/views/account_report.xml +++ b/addons/account/views/account_report.xml @@ -11,6 +11,7 @@ file="account.report_invoice_with_payments" attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')" print_report_name="(object._get_printed_report_name())" + groups="account.group_account_invoice" /> 802.02 Contra cuenta CUFIN 4 accounts - D + A 803.01 CUFIN de ejercicios anteriores diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index 43f4ae2a477..16507035982 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -18,7 +18,7 @@ function _parse_and_transform(nodes, transform_function) { // Suggested URL Javascript regex of http://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url // Adapted to make http(s):// not required if (and only if) www. is given. So `should.notmatch` does not match. -var url_regexp = /\b(?:https?:\/\/\d{1,3}(?:\.\d{1,3}){3}|(?:https?:\/\/|(?:www\.))[-a-z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13})\b(?:[-a-z0-9@:%_\+.~#?&//=]*)/gi; +var url_regexp = /\b(?:https?:\/\/\d{1,3}(?:\.\d{1,3}){3}|(?:https?:\/\/|(?:www\.))[-a-z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13})\b(?:[-a-z0-9@:%_\+.~#?&'$//=]*)/gi; function linkify(text, attrs) { attrs = attrs || {}; if (attrs.target === undefined) { diff --git a/addons/mail/static/tests/mail_utils_tests.js b/addons/mail/static/tests/mail_utils_tests.js index e8ec776a8d5..9bb8271e990 100644 --- a/addons/mail/static/tests/mail_utils_tests.js +++ b/addons/mail/static/tests/mail_utils_tests.js @@ -8,7 +8,7 @@ QUnit.module('mail', {}, function () { QUnit.module('Mail utils'); QUnit.test('add_link utility function', function (assert) { - assert.expect(7); + assert.expect(15); var testInputs = { 'http://admin:password@example.com:8/%2020': true, @@ -18,12 +18,15 @@ QUnit.test('add_link utility function', function (assert) { 'www.127.0.0.5': false, 'should.notmatch': false, 'fhttps://test.example.com/test': false, + "https://www.transifex.com/odoo/odoo-11/translate/#fr/lunch?q=text%3A'La+Tartiflette'": true, + 'https://www.transifex.com/odoo/odoo-11/translate/#fr/$/119303430?q=text%3ATartiflette': true, }; _.each(testInputs, function (willLinkify, content) { var output = utils.parse_and_transform(content, utils.add_link); if (willLinkify) { assert.strictEqual(output.indexOf(''), (output.length - 4), "Link should match the whole text"); } else { assert.strictEqual(output.indexOf(' + +