diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-06-14 21:28:39 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-06-14 21:28:39 +0200 |
| commit | b05e4d5f958892a9ff644b28a4ee165aeb2ea247 (patch) | |
| tree | 49c4237e12ae99f3f78e4b496b27dae4455db800 /addons | |
| parent | 5ac40752a4845340c4bd582075caaf0dd478d639 (diff) | |
| parent | a53bea49fe4005e3faaa3e63888da65a45281dd5 (diff) | |
[MERGE] forward port branch saas-15 up to a53bea49fe4
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/views/report_journal.xml | 2 | ||||
| -rw-r--r-- | addons/event/models/res_partner.py | 4 | ||||
| -rw-r--r-- | addons/event/views/res_partner_views.xml | 1 | ||||
| -rw-r--r-- | addons/mail/static/src/js/chat_manager.js | 2 | ||||
| -rw-r--r-- | addons/stock/models/stock_move.py | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/lib/summernote/src/js/module/Editor.js | 4 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/editor/rte.summernote.js | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/widgets.js | 5 | ||||
| -rw-r--r-- | addons/website/models/ir_http.py | 5 | ||||
| -rw-r--r-- | addons/website_event/controllers/main.py | 2 |
10 files changed, 19 insertions, 10 deletions
diff --git a/addons/account/views/report_journal.xml b/addons/account/views/report_journal.xml index 06dbab99ae4..c642b89347a 100644 --- a/addons/account/views/report_journal.xml +++ b/addons/account/views/report_journal.xml @@ -50,7 +50,7 @@ <td><span t-field="aml.date"/></td> <td><span t-field="aml.account_id.code"/></td> <td><span t-esc="aml.sudo().partner_id and aml.sudo().partner_id.name and aml.sudo().partner_id.name[:23] or ''"/></td> - <td><span t-esc="aml.name[:35]"/></td> + <td><span t-esc="aml.name and aml.name[:35]"/></td> <td><span t-esc="aml.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td> <td><span t-esc="aml.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td> <td t-if="data['form']['amount_currency'] and aml.amount_currency"> diff --git a/addons/event/models/res_partner.py b/addons/event/models/res_partner.py index 727de940fa1..009b182c1ae 100644 --- a/addons/event/models/res_partner.py +++ b/addons/event/models/res_partner.py @@ -9,8 +9,10 @@ class ResPartner(models.Model): event_count = fields.Integer("Events", compute='_compute_event_count', help="Number of events the partner has participated.") def _compute_event_count(self): + if not self.user_has_groups('event.group_event_user'): + return for partner in self: - partner.event_count = self.env['event.event'].sudo().search_count([('registration_ids.partner_id', 'child_of', partner.ids)]) + partner.event_count = self.env['event.event'].search_count([('registration_ids.partner_id', 'child_of', partner.ids)]) @api.multi def action_event_view(self): diff --git a/addons/event/views/res_partner_views.xml b/addons/event/views/res_partner_views.xml index 59d096efcd1..22aeba8686a 100644 --- a/addons/event/views/res_partner_views.xml +++ b/addons/event/views/res_partner_views.xml @@ -11,6 +11,7 @@ <button class="oe_stat_button" type="object" icon="fa-ticket" + groups="event.group_event_user" name="action_event_view" attrs="{'invisible': [('event_count','=', 0)]}"> <field string="Events" name="event_count" widget="statinfo"/> </button> diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index aed6186f9a8..d83054e0f0a 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -483,7 +483,7 @@ function on_partner_notification (data) { } remove_channel(channel); chat_manager.bus.trigger("unsubscribe_from_channel", data.id); - web_client.do_notify(_("Unsubscribed"), msg); + web_client.do_notify(_t("Unsubscribed"), msg); } } else if (data.type === 'toggle_star') { on_toggle_star_notification(data); diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index bb0dd9366fc..fd8350fe102 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -654,7 +654,7 @@ class StockMove(models.Model): self.product_uom = product.uom_id.id return {'domain': {'product_uom': [('category_id', '=', product.uom_id.category_id.id)]}} - @api.onchange('date') + @api.onchange('date_expected') def onchange_date(self): if self.date_expected: self.date = self.date_expected diff --git a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js index b7ba30bfcd1..99947c346cf 100644 --- a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js +++ b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js @@ -628,9 +628,9 @@ define([ } var anchors = []; - // ODOO: adding this branch to modify existing anchor + // ODOO: adding this branch to modify existing anchor if it fully contains the range var ancestor_anchor = dom.ancestor(rng.sc, dom.isAnchor); - if(ancestor_anchor) { + if(ancestor_anchor && ancestor_anchor === dom.ancestor(rng.ec, dom.isAnchor)) { anchors.push($(ancestor_anchor).html(linkText).get(0)); } else if (isTextChanged) { // Create a new link when text changed. diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js index 7289359290e..2b1f516af84 100644 --- a/addons/web_editor/static/src/js/editor/rte.summernote.js +++ b/addons/web_editor/static/src/js/editor/rte.summernote.js @@ -472,7 +472,7 @@ function prettify_html(html) { while (i--) space += ' '; return space; }, - reg = /^<\/?(a|span|font|strong|u|i|strong|b)(\s|>)/i, + reg = /^<\/?(a|span|font|u|em|i|strong|b)(\s|>)/i, inline_level = Infinity, tokens = _.compact(_.flatten(_.map(html.split(/</), function (value) { value = value.replace(/\s+/g, ' ').split(/>/); diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 7854c1852c6..4bad378490d 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -190,8 +190,7 @@ var ImageDialog = Widget.extend({ var img = this.images[0]; if (!img) { - var id = this.$(".existing-attachments [data-src]:first").data('id'); - img = _.find(this.images, function (img) { return img.id === id;}); + return this.media; } var def = $.when(); @@ -1196,6 +1195,8 @@ var LinkDialog = Dialog.extend({ if (dom.ancestor(nodes[i], dom.isImg)) { this.data.images.push(dom.ancestor(nodes[i], dom.isImg)); text += '[IMG]'; + } else if (!is_link && nodes[i].nodeType === 1) { + // just use text nodes from listBetween } else if (!is_link && i===0) { text += nodes[i].textContent.slice(so, Infinity); } else if (!is_link && i===nodes.length-1) { diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index 0e5443ad79e..aa703071d9b 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -6,6 +6,7 @@ import traceback import os import unittest +import pytz import werkzeug import werkzeug.routing import werkzeug.utils @@ -74,6 +75,10 @@ class Http(models.AbstractModel): context = {} if not request.context.get('tz'): context['tz'] = request.session.get('geoip', {}).get('time_zone') + try: + pytz.timezone(context['tz'] or '') + except pytz.UnknownTimeZoneError: + context.pop('tz') request.website = request.env['website'].get_current_website() # can use `request.env` since auth methods are called context['website_id'] = request.website.id diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index b9c08b8232e..7e4a9c227a6 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -259,6 +259,6 @@ class WebsiteEventController(http.Controller): Attendees._prepare_attendee_values(registration)) return request.render("website_event.registration_complete", { - 'attendees': Attendees, + 'attendees': Attendees.sudo(), 'event': event, }) |
