diff --git a/addons/document_page/static/src/js/document_page.js b/addons/document_page/static/src/js/document_page.js
index 555a39d7796..836803bf700 100644
--- a/addons/document_page/static/src/js/document_page.js
+++ b/addons/document_page/static/src/js/document_page.js
@@ -11,7 +11,7 @@ openerp.document_page = function (openerp) {
}
} else {
var wiki_value = wiky.process(show_value || '');
- this.$element.html(wiki_value);
+ this.$el.html(wiki_value);
}
},
});
diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js
index 78e90852c38..abb6d9a6232 100644
--- a/addons/edi/static/src/js/edi.js
+++ b/addons/edi/static/src/js/edi.js
@@ -28,14 +28,14 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
if (openerp.web.qweb.templates[template_content]) {
this.content = openerp.web.qweb.render(template_content, param);
}
- this.$element.html(openerp.web.qweb.render("EdiView", param));
- this.$element.find('button.oe_edi_action_print').bind('click', this.do_print);
- this.$element.find('button#oe_edi_import_existing').bind('click', this.do_import_existing);
- this.$element.find('button#oe_edi_import_create').bind('click', this.do_import_create);
- this.$element.find('button#oe_edi_download').bind('click', this.do_download);
- this.$element.find('.oe_edi_import_choice, .oe_edi_import_choice_label').bind('click', this.toggle_choice('import'));
- this.$element.find('.oe_edi_pay_choice, .oe_edi_pay_choice_label').bind('click', this.toggle_choice('pay'));
- this.$element.find('#oe_edi_download_show_code').bind('click', this.show_code);
+ this.$el.html(openerp.web.qweb.render("EdiView", param));
+ this.$el.find('button.oe_edi_action_print').bind('click', this.do_print);
+ this.$el.find('button#oe_edi_import_existing').bind('click', this.do_import_existing);
+ this.$el.find('button#oe_edi_import_create').bind('click', this.do_import_create);
+ this.$el.find('button#oe_edi_download').bind('click', this.do_download);
+ this.$el.find('.oe_edi_import_choice, .oe_edi_import_choice_label').bind('click', this.toggle_choice('import'));
+ this.$el.find('.oe_edi_pay_choice, .oe_edi_pay_choice_label').bind('click', this.toggle_choice('pay'));
+ this.$el.find('#oe_edi_download_show_code').bind('click', this.show_code);
},
on_document_failed: function(response) {
var self = this;
@@ -85,7 +85,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
},
do_import_existing: function(e) {
var url_download = this.get_download_url();
- var $edi_text_server_input = this.$element.find('#oe_edi_txt_server_url');
+ var $edi_text_server_input = this.$el.find('#oe_edi_txt_server_url');
var server_url = $edi_text_server_input.val();
$edi_text_server_input.removeClass('invalid');
if (!server_url) {
@@ -138,14 +138,14 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({
show_login: function() {
this.destroy_content();
this.login = new openerp.web.Login(this);
- this.login.appendTo(this.$element);
+ this.login.appendTo(this.$el);
},
destroy_content: function() {
_.each(_.clone(this.getChildren()), function(el) {
el.destroy();
});
- this.$element.children().remove();
+ this.$el.children().remove();
},
do_import: function() {
diff --git a/addons/event_sale/event_demo.xml b/addons/event_sale/event_demo.xml
index 3acd3c81f57..c3710623ef5 100644
--- a/addons/event_sale/event_demo.xml
+++ b/addons/event_sale/event_demo.xml
@@ -20,6 +20,7 @@
produce
+
/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAB+AJYDAREAAhEBAxEB/8QAHAAAAQUBAQEAAAAAAAAAAAAAAAMFBgcIBAIB/8QAPxAAAQMDAgMECAMFBwUAAAAAAQIDBAAFEQYSByExE0FRcQgUIjJhgZGhUoKxFUJywdEWFyMkQ2KzJURzksL/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8A2XQFAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFAUCUuTHiMKfkyGWGk9VuLCUjzJoGyJqjTkuQI8a/2t50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KFHmAt1Sh9jQPWmJDaNU3N9KgQrmkj44JoJi1OCse1QR3SaxbtYX63g7WpCkzGh/F733B+tBMkvg99AvQFAUBQfCM0HhQoE1JoEHE8qDleFAyXiM247HU4kK2r5ZHwoOGZCQQcHFBFtSQ1tsb0LT73fQRI2pl2UlxaGyvPvFOT9aDzcowadKxjkcCgerWVhhHtc8UDlZXltzXSCcnrQS2DLcOBk0CUx0s6qtUtPvPJcjr+IxuH6UEtZcVtoP/9k=
diff --git a/addons/google_map/static/src/js/google_map.js b/addons/google_map/static/src/js/google_map.js
index bd871eafe6b..23b70f5f6c3 100644
--- a/addons/google_map/static/src/js/google_map.js
+++ b/addons/google_map/static/src/js/google_map.js
@@ -59,7 +59,7 @@ openerp.event = function(instance, mod) {
address = _.str.sprintf('%(street)s, %(zip)s %(city)s', value);
}
// TODO repalce by widget_option selector self.options.selector
- var el = self.view.$element.find(".oe_google_map")[0];
+ var el = self.view.$el.find(".oe_google_map")[0];
self.map.render_map(address,el);
});
},
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 81a7ae6129e..6b4839b7b2b 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -19,18 +19,13 @@
#
##############################################################################
-import logging
import time
-from datetime import datetime
-
import tools
-from osv import fields, osv
-from openerp.modules.registry import RegistryManager
-from openerp import SUPERUSER_ID
-from base_status.base_stage import base_stage
-from tools.translate import _
-_logger = logging.getLogger(__name__)
+from base_status.base_stage import base_stage
+from datetime import datetime
+from osv import fields, osv
+from tools.translate import _
AVAILABLE_STATES = [
('draft', 'New'),
@@ -522,35 +517,8 @@ class hr_job(osv.osv):
def _auto_init(self, cr, context=None):
"""Installation hook to create aliases for all jobs and avoid constraint errors."""
-
- # disable the unique alias_id not null constraint, to avoid spurious warning during
- # super.auto_init. We'll reinstall it afterwards.
- self._columns['alias_id'].required = False
-
- super(hr_job,self)._auto_init(cr, context=context)
-
- registry = RegistryManager.get(cr.dbname)
- mail_alias = registry.get('mail.alias')
- hr_jobs = registry.get('hr.job')
- jobs_no_alias = hr_jobs.search(cr, SUPERUSER_ID, [('alias_id', '=', False)])
- # Use read() not browse(), to avoid prefetching uninitialized inherited fields
- for job_data in hr_jobs.read(cr, SUPERUSER_ID, jobs_no_alias, ['name']):
- alias_id = mail_alias.create_unique_alias(cr, SUPERUSER_ID, {'alias_name': 'job+'+job_data['name'],
- 'alias_defaults': {'job_id': job_data['id']}},
- model_name='hr.applicant')
- hr_jobs.write(cr, SUPERUSER_ID, job_data['id'], {'alias_id': alias_id})
- _logger.info('Mail alias created for hr.job %s (uid %s)', job_data['name'], job_data['id'])
-
- # Finally attempt to reinstate the missing constraint
- try:
- cr.execute('ALTER TABLE hr_job ALTER COLUMN alias_id SET NOT NULL')
- except Exception:
- _logger.warning("Table '%s': unable to set a NOT NULL constraint on column '%s' !\n"\
- "If you want to have it, you should update the records and execute manually:\n"\
- "ALTER TABLE %s ALTER COLUMN %s SET NOT NULL",
- self._table, 'alias_id', self._table, 'alias_id')
-
- self._columns['alias_id'].required = True
+ self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(hr_job,self)._auto_init,
+ self._columns['alias_id'], 'name', alias_prefix='job+', alias_defaults={'job_id': 'id'}, context=context)
def create(self, cr, uid, vals, context=None):
mail_alias = self.pool.get('mail.alias')
diff --git a/addons/hr_recruitment/static/src/js/hr_recruitment.js b/addons/hr_recruitment/static/src/js/hr_recruitment.js
index 5a2d6bd92b4..9a0a6e4c894 100644
--- a/addons/hr_recruitment/static/src/js/hr_recruitment.js
+++ b/addons/hr_recruitment/static/src/js/hr_recruitment.js
@@ -10,7 +10,7 @@ openerp.hr_recruitment = function(openerp) {
var categ_ids = [];
// Collect categories ids
- self.$element.find('span[data-categ_id]').each(function() {
+ self.$el.find('span[data-categ_id]').each(function() {
categ_ids.push($(this).data('categ_id'));
});
@@ -19,7 +19,7 @@ openerp.hr_recruitment = function(openerp) {
dataset.read_slice(['id', 'name']).then(function(result) {
_.each(result, function(v, k) {
// Set the proper value in the DOM and display the element
- self.$element.find('span[data-categ_id=' + v.id + ']').text(v.name);
+ self.$el.find('span[data-categ_id=' + v.id + ']').text(v.name);
});
});
},
diff --git a/addons/mail/mail_alias.py b/addons/mail/mail_alias.py
index 82b20f39480..70280e64a5d 100644
--- a/addons/mail/mail_alias.py
+++ b/addons/mail/mail_alias.py
@@ -19,11 +19,16 @@
#
##############################################################################
+import logging
import re
import unicodedata
from openerp.osv import fields, osv
from openerp.tools import ustr
+from openerp.modules.registry import RegistryManager
+from openerp import SUPERUSER_ID
+
+_logger = logging.getLogger(__name__)
# Inspired by http://stackoverflow.com/questions/517923
def remove_accents(input_str):
@@ -129,6 +134,56 @@ class mail_alias(osv.Model):
sequence = (sequence + 1) if sequence else 2
return new_name
+ def migrate_to_alias(self, cr, child_model_name, child_table_name, child_model_auto_init_fct,
+ alias_id_column, alias_key, alias_prefix = '', alias_force_key = '', alias_defaults = {}, context=None):
+ """ Installation hook to create aliases for all users and avoid constraint errors.
+
+ :param child_model_name: model name of the child class (i.e. res.users)
+ :param child_table_name: table name of the child class (i.e. res_users)
+ :param child_model_auto_init_fct: pointer to the _auto_init function
+ (i.e. super(res_users,self)._auto_init(cr, context=context))
+ :param alias_id_column: alias_id column (i.e. self._columns['alias_id'])
+ :param alias_key: name of the column used for the unique name (i.e. 'login')
+ :param alias_prefix: prefix for the unique name (i.e. 'jobs' + ...)
+ :param alias_force_key': name of the column for force_thread_id;
+ if empty string, not taken into account
+ :param alias_defaults: dict, keys = mail.alias columns, values = child
+ model column name used for default values (i.e. {'job_id': 'id'})
+ """
+
+ # disable the unique alias_id not null constraint, to avoid spurious warning during
+ # super.auto_init. We'll reinstall it afterwards.
+ alias_id_column.required = False
+
+ # call _auto_init
+ child_model_auto_init_fct(cr, context=context)
+
+ registry = RegistryManager.get(cr.dbname)
+ mail_alias = registry.get('mail.alias')
+ child_class_model = registry.get(child_model_name)
+ no_alias_ids = child_class_model.search(cr, SUPERUSER_ID, [('alias_id', '=', False)])
+ # Use read() not browse(), to avoid prefetching uninitialized inherited fields
+ for obj_data in child_class_model.read(cr, SUPERUSER_ID, no_alias_ids, [alias_key]):
+ alias_vals = {'alias_name': '%s%s' % (alias_prefix, obj_data[alias_key]) }
+ if alias_force_key:
+ alias_vals['alias_force_thread_id'] = obj_data[alias_force_key]
+ alias_vals['alias_defaults'] = dict( (k, obj_data[v]) for k, v in alias_defaults.iteritems())
+ alias_id = mail_alias.create_unique_alias(cr, SUPERUSER_ID, alias_vals, model_name=child_model_name)
+ child_class_model.write(cr, SUPERUSER_ID, obj_data['id'], {'alias_id': alias_id})
+ _logger.info('Mail alias created for %s %s (uid %s)', child_model_name, obj_data[alias_key], obj_data['id'])
+
+ # Finally attempt to reinstate the missing constraint
+ try:
+ cr.execute('ALTER TABLE %s ALTER COLUMN alias_id SET NOT NULL' % (child_table_name))
+ except Exception:
+ _logger.warning("Table '%s': unable to set a NOT NULL constraint on column '%s' !\n"\
+ "If you want to have it, you should update the records and execute manually:\n"\
+ "ALTER TABLE %s ALTER COLUMN %s SET NOT NULL",
+ child_table_name, 'alias_id', child_table_name, 'alias_id')
+
+ # set back the unique alias_id constraint
+ alias_id_column.required = True
+
def create_unique_alias(self, cr, uid, vals, model_name=None, context=None):
"""Creates an email.alias record according to the values provided in ``vals``,
with 2 alterations: the ``alias_name`` value may be suffixed in order to
diff --git a/addons/mail/res_users.py b/addons/mail/res_users.py
index f985ac4f88d..d9c77cb83f4 100644
--- a/addons/mail/res_users.py
+++ b/addons/mail/res_users.py
@@ -19,15 +19,10 @@
#
##############################################################################
-import logging
-
from osv import osv, fields
-from openerp.modules.registry import RegistryManager
from openerp import SUPERUSER_ID
from tools.translate import _
-_logger = logging.getLogger(__name__)
-
class res_users(osv.Model):
""" Update of res.users class
- add a preference about sending emails about notifications
@@ -69,35 +64,8 @@ class res_users(osv.Model):
def _auto_init(self, cr, context=None):
"""Installation hook to create aliases for all users and avoid constraint errors."""
-
- # disable the unique alias_id not null constraint, to avoid spurious warning during
- # super.auto_init. We'll reinstall it afterwards.
- self._columns['alias_id'].required = False
-
- super(res_users,self)._auto_init(cr, context=context)
-
- registry = RegistryManager.get(cr.dbname)
- mail_alias = registry.get('mail.alias')
- res_users_model = registry.get('res.users')
- users_no_alias = res_users_model.search(cr, SUPERUSER_ID, [('alias_id', '=', False)])
- # Use read() not browse(), to avoid prefetching uninitialized inherited fields
- for user_data in res_users_model.read(cr, SUPERUSER_ID, users_no_alias, ['login']):
- alias_id = mail_alias.create_unique_alias(cr, SUPERUSER_ID, {'alias_name': user_data['login'],
- 'alias_force_id': user_data['id']},
- model_name=self._name)
- res_users_model.write(cr, SUPERUSER_ID, user_data['id'], {'alias_id': alias_id})
- _logger.info('Mail alias created for user %s (uid %s)', user_data['login'], user_data['id'])
-
- # Finally attempt to reinstate the missing constraint
- try:
- cr.execute('ALTER TABLE res_users ALTER COLUMN alias_id SET NOT NULL')
- except Exception:
- _logger.warning("Table '%s': unable to set a NOT NULL constraint on column '%s' !\n"\
- "If you want to have it, you should update the records and execute manually:\n"\
- "ALTER TABLE %s ALTER COLUMN %s SET NOT NULL",
- self._table, 'alias_id', self._table, 'alias_id')
-
- self._columns['alias_id'].required = True
+ self.pool.get('mail.alias').migrate_to_alias(cr, self._name, self._table, super(res_users,self)._auto_init,
+ self._columns['alias_id'], 'login', alias_force_key='id', context=context)
def create(self, cr, uid, data, context=None):
# create default alias same as the login
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 00242ecee38..e3d688e3337 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -57,7 +57,7 @@ openerp.mail = function(session) {
/* generic chatter events binding */
bind_events: function(widget) {
// event: click on an internal link to a document: model, login
- widget.$element.delegate('a.oe_mail_internal_link', 'click', function (event) {
+ widget.$el.delegate('a.oe_mail_internal_link', 'click', function (event) {
event.preventDefault();
// lazy implementation: fetch data and try to redirect
if (! event.srcElement.dataset.resModel) return false;
@@ -344,8 +344,8 @@ openerp.mail = function(session) {
// customize display: add avatar, clean previous content
var user_avatar = mail.ChatterUtils.get_image(this.session.prefix,
this.session.session_id, 'res.users', 'image_small', this.session.uid);
- this.$element.find('img.oe_mail_icon').attr('src', user_avatar);
- this.$element.find('div.oe_mail_msg_content').empty();
+ this.$el.find('img.oe_mail_icon').attr('src', user_avatar);
+ this.$el.find('div.oe_mail_msg_content').empty();
// create a context for the default_get of the compose form
var widget_context = {
'active_model': this.params.res_model,
@@ -378,7 +378,7 @@ openerp.mail = function(session) {
disable_autofocus: true,
});
// add the form, bind events, activate the form
- var msg_node = this.$element.find('div.oe_mail_msg_content');
+ var msg_node = this.$el.find('div.oe_mail_msg_content');
return $.when(this.form_view.appendTo(msg_node)).pipe(function() {
self.bind_events();
self.form_view.do_show();
@@ -396,31 +396,31 @@ openerp.mail = function(session) {
* in the function. */
bind_events: function() {
var self = this;
- this.$element.find('button.oe_form_button').click(function (event) {
+ this.$el.find('button.oe_form_button').click(function (event) {
event.preventDefault();
});
// event: click on 'Send an Email' link that toggles the form for
// sending an email (partner_ids)
- this.$element.find('a.oe_mail_compose_message_email').click(function (event) {
+ this.$el.find('a.oe_mail_compose_message_email').click(function (event) {
event.preventDefault();
self.toggle_email_mode();
});
// event: click on 'Formatting' icon-link that toggles the advanced
// formatting options for writing a message (subject, body_html)
- this.$element.find('a.oe_mail_compose_message_formatting').click(function (event) {
+ this.$el.find('a.oe_mail_compose_message_formatting').click(function (event) {
event.preventDefault();
self.toggle_formatting_mode();
});
// event: click on 'Attachment' icon-link that opens the dialog to
// add an attachment.
- this.$element.find('a.oe_mail_compose_message_attachment').click(function (event) {
+ this.$el.find('a.oe_mail_compose_message_attachment').click(function (event) {
event.preventDefault();
// not yet implemented
self.set_body_value('attachment', 'attachment');
});
// event: click on 'Checklist' icon-link that toggles the options
// for adding checklist.
- this.$element.find('a.oe_mail_compose_message_checklist').click(function (event) {
+ this.$el.find('a.oe_mail_compose_message_checklist').click(function (event) {
event.preventDefault();
// not yet implemented
self.set_body_value('checklist', 'checklist');
@@ -440,9 +440,9 @@ openerp.mail = function(session) {
// update context of datasetsearch
this.ds_compose.context.formatting = this.formatting;
// toggle display
- this.$element.find('span.oe_mail_compose_message_subject').toggleClass('oe_mail_compose_message_invisible');
- this.$element.find('div.oe_mail_compose_message_body_text').toggleClass('oe_mail_compose_message_invisible');
- this.$element.find('div.oe_mail_compose_message_body_html').toggleClass('oe_mail_compose_message_invisible');
+ this.$el.find('span.oe_mail_compose_message_subject').toggleClass('oe_mail_compose_message_invisible');
+ this.$el.find('div.oe_mail_compose_message_body_text').toggleClass('oe_mail_compose_message_invisible');
+ this.$el.find('div.oe_mail_compose_message_body_html').toggleClass('oe_mail_compose_message_invisible');
},
/**
@@ -460,14 +460,14 @@ openerp.mail = function(session) {
// update 'Post' button -> 'Send'
// update 'Send an Email' link -> 'Post a comment'
if (this.email_mode) {
- this.$element.find('button.oe_mail_compose_message_button_send').html('
Send');
- this.$element.find('a.oe_mail_compose_message_email').html('Comment');
+ this.$el.find('button.oe_mail_compose_message_button_send').html('
Send');
+ this.$el.find('a.oe_mail_compose_message_email').html('Comment');
} else {
- this.$element.find('button.oe_mail_compose_message_button_send').html('
Post');
- this.$element.find('a.oe_mail_compose_message_email').html('Send an Email');
+ this.$el.find('button.oe_mail_compose_message_button_send').html('
Post');
+ this.$el.find('a.oe_mail_compose_message_email').html('Send an Email');
}
// toggle display
- this.$element.find('div.oe_mail_compose_message_partner_ids').toggleClass('oe_mail_compose_message_invisible');
+ this.$el.find('div.oe_mail_compose_message_partner_ids').toggleClass('oe_mail_compose_message_invisible');
},
/**
@@ -581,14 +581,14 @@ openerp.mail = function(session) {
'res_id': this.params.res_id, 'mode': mode || 'comment', 'msg_id': msg_id,
'email_mode': email_mode || false, 'formatting': formatting || false,
'context': context || false } );
- var composition_node = this.$element.find('div.oe_mail_thread_action');
+ var composition_node = this.$el.find('div.oe_mail_thread_action');
composition_node.empty();
var compose_done = this.compose_message_widget.appendTo(composition_node);
return compose_done;
},
do_customize_display: function() {
- if (this.display.show_post_comment) { this.$element.find('div.oe_mail_thread_action').eq(0).show(); }
+ if (this.display.show_post_comment) { this.$el.find('div.oe_mail_thread_action').eq(0).show(); }
},
/**
@@ -599,29 +599,29 @@ openerp.mail = function(session) {
// generic events from Chatter Mixin
mail.ChatterUtils.bind_events(this);
// event: click on 'more' at bottom of thread
- this.$element.find('button.oe_mail_button_more').click(function () {
+ this.$el.find('button.oe_mail_button_more').click(function () {
self.do_more();
});
// event: writing in basic textarea of composition form (quick reply)
- this.$element.find('textarea.oe_mail_compose_textarea').keyup(function (event) {
+ this.$el.find('textarea.oe_mail_compose_textarea').keyup(function (event) {
var charCode = (event.which) ? event.which : window.event.keyCode;
if (event.shiftKey && charCode == 13) { this.value = this.value+"\n"; }
else if (charCode == 13) { return self.do_comment(); }
});
// event: click on 'Reply' in msg
- this.$element.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_reply', 'click', function (event) {
+ this.$el.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_reply', 'click', function (event) {
var act_dom = $(this).parents('div.oe_mail_thread_display').find('div.oe_mail_thread_action:first');
act_dom.toggle();
event.preventDefault();
});
// event: click on 'attachment(s)' in msg
- this.$element.delegate('a.oe_mail_msg_view_attachments', 'click', function (event) {
+ this.$el.delegate('a.oe_mail_msg_view_attachments', 'click', function (event) {
var act_dom = $(this).parent().parent().parent().find('.oe_mail_msg_attachments');
act_dom.toggle();
event.preventDefault();
});
// event: click on 'Delete' in msg side menu
- this.$element.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_delete', 'click', function (event) {
+ this.$el.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_delete', 'click', function (event) {
if (! confirm(_t("Do you really want to delete this message?"))) { return false; }
var msg_id = event.srcElement.dataset.id;
if (! msg_id) return false;
@@ -634,7 +634,7 @@ openerp.mail = function(session) {
return call_defer;
});
// event: click on 'Hide' in msg side menu
- this.$element.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_hide', 'click', function (event) {
+ this.$el.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_hide', 'click', function (event) {
if (! confirm(_t("Do you really want to hide this thread ?"))) { return false; }
var msg_id = event.srcElement.dataset.id;
if (! msg_id) return false;
@@ -647,7 +647,7 @@ openerp.mail = function(session) {
return call_defer;
});
// event: click on "Reply" in msg side menu (email style)
- this.$element.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_reply_by_email', 'click', function (event) {
+ this.$el.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_reply_by_email', 'click', function (event) {
var msg_id = event.srcElement.dataset.msg_id;
var email_mode = (event.srcElement.dataset.type == 'email');
var formatting = (event.srcElement.dataset.formatting == 'html');
@@ -665,7 +665,7 @@ openerp.mail = function(session) {
var self = this;
this.params.offset = 0;
this.comments_structure = {'root_ids': [], 'new_root_ids': [], 'msgs': {}, 'tree_struct': {}, 'model_to_root_ids': {}};
- this.$element.find('div.oe_mail_thread_display').empty();
+ this.$el.find('div.oe_mail_thread_display').empty();
var domain = this.get_fetch_domain(this.comments_structure);
return this.fetch_comments(this.params.limit, this.params.offset, domain).then();
},
@@ -680,8 +680,8 @@ openerp.mail = function(session) {
else { self.display.show_more = true; }
self.display_comments(records);
// TODO: move to customize display
- if (self.display.show_more == true) self.$element.find('div.oe_mail_thread_more:last').show();
- else self.$element.find('div.oe_mail_thread_more:last').hide();
+ if (self.display.show_more == true) self.$el.find('div.oe_mail_thread_more:last').show();
+ else self.$el.find('div.oe_mail_thread_more:last').hide();
});
return defer;
@@ -725,8 +725,8 @@ openerp.mail = function(session) {
self.thread = new mail.Thread(self, {'res_model': self.params.res_model, 'res_id': self.params.res_id, 'uid': self.params.uid,
'records': sub_msgs, 'thread_level': (self.params.thread_level-1), 'parent_id': record.id,
'is_wall': self.params.is_wall});
- self.$element.find('li.oe_mail_thread_msg:last').append('
');
- self.thread.appendTo(self.$element.find('div.oe_mail_thread_subthread:last'));
+ self.$el.find('li.oe_mail_thread_msg:last').append('
');
+ self.thread.appendTo(self.$el.find('div.oe_mail_thread_subthread:last'));
}
else if (self.params.thread_level == 0) {
self.display_comment(record);
@@ -758,8 +758,8 @@ openerp.mail = function(session) {
// render
var rendered = session.web.qweb.render('mail.thread.message', {'record': record, 'thread': this, 'params': this.params, 'display': this.display});
// expand feature
- $(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first'));
- this.$element.find('div.oe_mail_msg_record_body').expander({
+ $(rendered).appendTo(this.$el.children('div.oe_mail_thread_display:first'));
+ this.$el.find('div.oe_mail_msg_record_body').expander({
slicePoint: this.params.msg_more_limit,
expandText: 'read more',
userCollapseText: '[^]',
@@ -771,11 +771,11 @@ openerp.mail = function(session) {
display_current_user: function () {
var avatar = mail.ChatterUtils.get_image(this.session.prefix, this.session.session_id, 'res.users', 'image_small', this.params.uid);
- return this.$element.find('img.oe_mail_icon').attr('src', avatar);
+ return this.$el.find('img.oe_mail_icon').attr('src', avatar);
},
do_comment: function () {
- var comment_node = this.$element.find('textarea');
+ var comment_node = this.$el.find('textarea');
var body_text = comment_node.val();
comment_node.val('');
return this.ds.call('message_append_note', [[this.params.res_id], '', body_text, this.params.parent_id, 'comment', 'plain']).then(
@@ -851,17 +851,17 @@ openerp.mail = function(session) {
this.view.on("change:actual_mode", this, this._check_visibility);
this._check_visibility();
mail.ChatterUtils.bind_events(this);
- this.$element.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); });
+ this.$el.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); });
if (! this.params.see_subscribers_options) {
- this.$element.find('button.oe_mail_button_followers').hide(); }
- this.$element.find('button.oe_mail_button_follow').click(function () { self.do_follow(); });
- this.$element.find('button.oe_mail_button_unfollow').click(function () { self.do_unfollow(); })
+ this.$el.find('button.oe_mail_button_followers').hide(); }
+ this.$el.find('button.oe_mail_button_follow').click(function () { self.do_follow(); });
+ this.$el.find('button.oe_mail_button_unfollow').click(function () { self.do_unfollow(); })
.mouseover(function () { $(this).html('Unfollow').removeClass('oe_mail_button_mouseout').addClass('oe_mail_button_mouseover'); })
.mouseleave(function () { $(this).html('Following').removeClass('oe_mail_button_mouseover').addClass('oe_mail_button_mouseout'); });
},
_check_visibility: function() {
- this.$element.toggle(this.view.get("actual_mode") !== "create");
+ this.$el.toggle(this.view.get("actual_mode") !== "create");
},
destroy: function () {
@@ -872,15 +872,15 @@ openerp.mail = function(session) {
this._super.apply(this, arguments);
if (! this.view.datarecord.id ||
session.web.BufferedDataSet.virtual_id_regex.test(this.view.datarecord.id)) {
- this.$element.find('.oe_mail_thread').hide();
+ this.$el.find('.oe_mail_thread').hide();
return;
}
// create and render Thread widget
- this.$element.find('div.oe_mail_recthread_main').empty();
+ this.$el.find('div.oe_mail_recthread_main').empty();
if (this.thread) this.thread.destroy();
this.thread = new mail.Thread(this, {'res_model': this.view.model, 'res_id': this.view.datarecord.id, 'uid': this.session.uid,
'thread_level': this.params.thread_level, 'show_post_comment': true, 'limit': 15});
- var thread_done = this.thread.appendTo(this.$element.find('div.oe_mail_recthread_main'));
+ var thread_done = this.thread.appendTo(this.$el.find('div.oe_mail_recthread_main'));
return thread_done;
},
});
@@ -965,7 +965,7 @@ openerp.mail = function(session) {
this.compose_message_widget = new mail.ComposeMessage(this, {
'extended_mode': false, 'uid': this.session.uid, 'res_model': this.params.res_model,
'res_id': this.params.res_id, 'mode': mode || 'comment', 'msg_id': msg_id });
- var composition_node = this.$element.find('div.oe_mail_wall_action');
+ var composition_node = this.$el.find('div.oe_mail_wall_action');
composition_node.empty();
var compose_done = this.compose_message_widget.appendTo(composition_node);
return compose_done;
@@ -975,7 +975,7 @@ openerp.mail = function(session) {
add_event_handlers: function () {
var self = this;
// display more threads
- this.$element.find('button.oe_mail_wall_button_more').click(function () { return self.do_more(); });
+ this.$el.find('button.oe_mail_wall_button_more').click(function () { return self.do_more(); });
},
/**
@@ -987,7 +987,7 @@ openerp.mail = function(session) {
load_search_view: function (view_id, defaults, hidden) {
var self = this;
this.searchview = new session.web.SearchView(this, this.ds_msg, view_id || false, defaults || {}, hidden || false);
- var search_view_loaded = this.searchview.appendTo(this.$element.find('.oe_view_manager_view_search'));
+ var search_view_loaded = this.searchview.appendTo(this.$el.find('.oe_view_manager_view_search'));
return $.when(search_view_loaded).then(function () {
self.searchview.on_search.add(self.do_searchview_search);
});
@@ -1016,7 +1016,7 @@ openerp.mail = function(session) {
},
display_current_user: function () {
- //return this.$element.find('img.oe_mail_msg_image').attr('src', this.thread_get_avatar('res.users', 'avatar', this.session.uid));
+ //return this.$el.find('img.oe_mail_msg_image').attr('src', this.thread_get_avatar('res.users', 'avatar', this.session.uid));
},
/**
@@ -1031,7 +1031,7 @@ openerp.mail = function(session) {
this.search['context'] = _.extend(this.params.context, this.search_results.context);
this.display_show_more = true;
this.comments_structure = {'root_ids': [], 'new_root_ids': [], 'msgs': {}, 'tree_struct': {}, 'model_to_root_ids': {}};
- this.$element.find('ul.oe_mail_wall_threads').empty();
+ this.$el.find('ul.oe_mail_wall_threads').empty();
return this.fetch_comments(this.params.limit, 0);
},
@@ -1064,13 +1064,13 @@ openerp.mail = function(session) {
var model_name = self.comments_structure.msgs[root_id]['model'];
var res_id = self.comments_structure.msgs[root_id]['res_id'];
var render_res = session.web.qweb.render('mail.wall_thread_container', {});
- $('
').html(render_res).appendTo(self.$element.find('ul.oe_mail_wall_threads'));
+ $('').html(render_res).appendTo(self.$el.find('ul.oe_mail_wall_threads'));
var thread = new mail.Thread(self, {
'res_model': model_name, 'res_id': res_id, 'uid': self.session.uid, 'records': records,
'parent_id': false, 'thread_level': self.params.thread_level, 'show_hide': true, 'is_wall': true}
);
self.thread_list.push(thread);
- return thread.appendTo(self.$element.find('li.oe_mail_wall_thread:last'));
+ return thread.appendTo(self.$el.find('li.oe_mail_wall_thread:last'));
});
// update TODO
this.comments_structure['root_ids'] = _.union(this.comments_structure['root_ids'], this.comments_structure['new_root_ids']);
@@ -1097,8 +1097,8 @@ openerp.mail = function(session) {
/** Display update: show more button */
do_update_show_more: function (new_value) {
if (new_value != undefined) this.display_show_more = new_value;
- if (this.display_show_more) this.$element.find('div.oe_mail_wall_more:last').show();
- else this.$element.find('div.oe_mail_wall_more:last').hide();
+ if (this.display_show_more) this.$el.find('div.oe_mail_wall_more:last').show();
+ else this.$el.find('div.oe_mail_wall_more:last').hide();
},
/** Action: Shows more discussions */
diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js
index 0e920f73041..eda56231d69 100644
--- a/addons/mail/static/src/js/mail_followers.js
+++ b/addons/mail/static/src/js/mail_followers.js
@@ -40,20 +40,20 @@ openerp_mail_followers = function(session, mail) {
// any other method to know if the view is in create mode anymore
this.view.on("change:actual_mode", this, this._check_visibility);
this._check_visibility();
- this.$element.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); });
+ this.$el.find('button.oe_mail_button_followers').click(function () { self.do_toggle_followers(); });
if (! this.params.display_control) {
- this.$element.find('button.oe_mail_button_followers').hide(); }
- this.$element.find('button.oe_mail_button_follow').click(function () { self.do_follow(); })
+ this.$el.find('button.oe_mail_button_followers').hide(); }
+ this.$el.find('button.oe_mail_button_follow').click(function () { self.do_follow(); })
.mouseover(function () { $(this).html('Follow').removeClass('oe_mail_button_mouseout').addClass('oe_mail_button_mouseover'); })
.mouseleave(function () { $(this).html('Not following').removeClass('oe_mail_button_mouseover').addClass('oe_mail_button_mouseout'); });
- this.$element.find('button.oe_mail_button_unfollow').click(function () { self.do_unfollow(); })
+ this.$el.find('button.oe_mail_button_unfollow').click(function () { self.do_unfollow(); })
.mouseover(function () { $(this).html('Unfollow').removeClass('oe_mail_button_mouseout').addClass('oe_mail_button_mouseover'); })
.mouseleave(function () { $(this).html('Following').removeClass('oe_mail_button_mouseover').addClass('oe_mail_button_mouseout'); });
this.reinit();
},
_check_visibility: function() {
- this.$element.toggle(this.view.get("actual_mode") !== "create");
+ this.$el.toggle(this.view.get("actual_mode") !== "create");
},
destroy: function () {
@@ -64,16 +64,16 @@ openerp_mail_followers = function(session, mail) {
this.params.display_followers = true;
this.params.display_control = this.node.attrs.display_control || false;
this.params.display_actions = this.node.attrs.display_actions || false;
- this.$element.find('button.oe_mail_button_followers').html('Hide followers')
- this.$element.find('button.oe_mail_button_follow').hide();
- this.$element.find('button.oe_mail_button_unfollow').hide();
+ this.$el.find('button.oe_mail_button_followers').html('Hide followers')
+ this.$el.find('button.oe_mail_button_follow').hide();
+ this.$el.find('button.oe_mail_button_unfollow').hide();
},
set_value: function(value_) {
this.reinit();
if (! this.view.datarecord.id ||
session.web.BufferedDataSet.virtual_id_regex.test(this.view.datarecord.id)) {
- this.$element.find('div.oe_mail_recthread_aside').hide();
+ this.$el.find('div.oe_mail_recthread_aside').hide();
return;
}
return this.fetch_subscribers(value_);
@@ -89,19 +89,19 @@ openerp_mail_followers = function(session, mail) {
display_subscribers: function (records) {
var self = this;
this.is_subscriber = false;
- var user_list = this.$element.find('ul.oe_mail_followers_display').empty();
- this.$element.find('div.oe_mail_recthread_followers h4').html(this.params.title + ' (' + records.length + ')');
+ var user_list = this.$el.find('ul.oe_mail_followers_display').empty();
+ this.$el.find('div.oe_mail_recthread_followers h4').html(this.params.title + ' (' + records.length + ')');
_(records).each(function (record) {
if (record.id == self.session.uid) { self.is_subscriber = true; }
record.avatar_url = mail.ChatterUtils.get_image(self.session.prefix, self.session.session_id, 'res.users', 'image_small', record.id);
$(session.web.qweb.render('mail.followers.partner', {'record': record})).appendTo(user_list);
});
if (this.is_subscriber) {
- this.$element.find('button.oe_mail_button_follow').hide();
- this.$element.find('button.oe_mail_button_unfollow').show(); }
+ this.$el.find('button.oe_mail_button_follow').hide();
+ this.$el.find('button.oe_mail_button_unfollow').show(); }
else {
- this.$element.find('button.oe_mail_button_follow').show();
- this.$element.find('button.oe_mail_button_unfollow').hide(); }
+ this.$el.find('button.oe_mail_button_follow').show();
+ this.$el.find('button.oe_mail_button_unfollow').hide(); }
},
do_follow: function () {
@@ -114,9 +114,9 @@ openerp_mail_followers = function(session, mail) {
do_toggle_followers: function () {
this.params.see_subscribers = ! this.params.see_subscribers;
- if (this.params.see_subscribers) { this.$element.find('button.oe_mail_button_followers').html('Hide followers'); }
- else { this.$element.find('button.oe_mail_button_followers').html('Show followers'); }
- this.$element.find('div.oe_mail_recthread_followers').toggle();
+ if (this.params.see_subscribers) { this.$el.find('button.oe_mail_button_followers').html('Hide followers'); }
+ else { this.$el.find('button.oe_mail_button_followers').html('Show followers'); }
+ this.$el.find('div.oe_mail_recthread_followers').toggle();
},
});
};
diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js
index 6384eb72da8..df182650afe 100644
--- a/addons/pad/static/src/js/pad.js
+++ b/addons/pad/static/src/js/pad.js
@@ -5,8 +5,8 @@ instance.web.form.FieldPad = instance.web.form.AbstractField.extend(instance.web
initialize_content: function() {
var self = this;
this.$textarea = undefined;
- this.$element.find('div.oe_etherpad_head').click(function(ev) {
- self.$element.toggleClass('oe_etherpad_fullscreen').toggleClass('oe_etherpad_normal');
+ this.$el.find('div.oe_etherpad_head').click(function(ev) {
+ self.$el.toggleClass('oe_etherpad_fullscreen').toggleClass('oe_etherpad_normal');
});
},
set_value: function(value_) {
@@ -21,12 +21,12 @@ instance.web.form.FieldPad = instance.web.form.AbstractField.extend(instance.web
if (!this.get("effective_readonly")) {
var pad_username = this.session.username;
var code = '';
- this.$element.find('div.oe_etherpad_default').html(code);
+ this.$el.find('div.oe_etherpad_default').html(code);
} else {
$.get(url+'/export/html').success(function(data) {
- self.$element.html(''+data+'
');
+ self.$el.html(''+data+'
');
}).error(function() {
- self.$element.text('Unable to load pad');
+ self.$el.text('Unable to load pad');
});
}
}
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 6487eebbe4f..dce19ab77b6 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -877,13 +877,17 @@