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/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/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 738eadb08c5..4d4e09575ea 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -225,13 +225,13 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
// with add_action_button()
show_action_bar: function(){
this.pos_widget.action_bar.show();
- this.$element.css({'bottom':'105px'});
+ this.$el.css({'bottom':'105px'});
},
// hides the action bar. The actionbar is automatically hidden when it is empty
hide_action_bar: function(){
this.pos_widget.action_bar.hide();
- this.$element.css({'bottom':'0px'});
+ this.$el.css({'bottom':'0px'});
},
// adds a new button to the action bar. The button definition takes three parameters, all optional :
@@ -250,8 +250,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
var self = this;
this.hidden = false;
- if(this.$element){
- this.$element.show();
+ if(this.$el){
+ this.$el.show();
}
if(this.pos_widget.action_bar.get_button_count() > 0){
@@ -311,8 +311,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
// POS initialization.
hide: function(){
this.hidden = true;
- if(this.$element){
- this.$element.hide();
+ if(this.$el){
+ this.$el.hide();
}
},
@@ -323,8 +323,8 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
renderElement: function(){
this._super();
if(this.hidden){
- if(this.$element){
- this.$element.hide();
+ if(this.$el){
+ this.$el.hide();
}
}
},
@@ -332,13 +332,13 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
module.PopUpWidget = module.PosBaseWidget.extend({
show: function(){
- if(this.$element){
- this.$element.show();
+ if(this.$el){
+ this.$el.show();
}
},
hide: function(){
- if(this.$element){
- this.$element.hide();
+ if(this.$el){
+ this.$el.hide();
}
},
});
@@ -350,7 +350,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this.pos.proxy.help_needed();
var self = this;
- this.$element.find('.button').off('click').click(function(){
+ this.$el.find('.button').off('click').click(function(){
self.pos_widget.screen_selector.close_popup();
self.pos.proxy.help_canceled();
});
@@ -700,7 +700,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
},
refresh: function() {
this.currentOrder = this.pos.get('selectedOrder');
- $('.pos-receipt-container', this.$element).html(QWeb.render('PosTicket',{widget:this}));
+ $('.pos-receipt-container', this.$el).html(QWeb.render('PosTicket',{widget:this}));
},
});
diff --git a/addons/point_of_sale/static/src/js/widget_base.js b/addons/point_of_sale/static/src/js/widget_base.js
index 62097f39db3..0aa0a44e7e7 100644
--- a/addons/point_of_sale/static/src/js/widget_base.js
+++ b/addons/point_of_sale/static/src/js/widget_base.js
@@ -35,10 +35,10 @@ function openerp_pos_basewidget(instance, module){ //module is instance.point_of
},
show: function(){
- this.$element.show();
+ this.$el.show();
},
hide: function(){
- this.$element.hide();
+ this.$el.hide();
},
});
diff --git a/addons/point_of_sale/static/src/js/widget_scrollbar.js b/addons/point_of_sale/static/src/js/widget_scrollbar.js
index 7c765028231..e4660a9c458 100644
--- a/addons/point_of_sale/static/src/js/widget_scrollbar.js
+++ b/addons/point_of_sale/static/src/js/widget_scrollbar.js
@@ -63,12 +63,12 @@ function openerp_pos_scrollbar(instance, module){ //module is instance.point_of_
this.update_scroller_dimensions(false);
this.update_button_status();
this.auto_hide(false);
- this.$element.bind('mousewheel',function(event,delta){
+ this.$el.bind('mousewheel',function(event,delta){
self.scroll(delta*self.wheel_step);
return false;
});
- this.$element.bind('click',function(event){
- var vpos = event.pageY - self.$element.offset().top;
+ this.$el.bind('click',function(event){
+ var vpos = event.pageY - self.$el.offset().top;
var spos = self.scroller_dimensions();
if(vpos > spos.bar_pos && vpos < spos.pos){
self.page_up();
@@ -106,9 +106,9 @@ function openerp_pos_scrollbar(instance, module){ //module is instance.point_of_
// shows the scrollbar. if animated is true, it will do it in an animated fashion
show: function(animated){ //FIXME: animated show and hide don't work ... ?
if(animated){
- this.$element.show().animate({'width':'48px'}, 500, 'swing');
+ this.$el.show().animate({'width':'48px'}, 500, 'swing');
}else{
- this.$element.show().css('width','48px');
+ this.$el.show().css('width','48px');
}
this.on_show(this);
},
@@ -117,9 +117,9 @@ function openerp_pos_scrollbar(instance, module){ //module is instance.point_of_
hide: function(animated){
var self = this;
if(animated){
- this.$element.animate({'width':'0px'}, 500, 'swing', function(){ self.$element.hide();});
+ this.$el.animate({'width':'0px'}, 500, 'swing', function(){ self.$el.hide();});
}else{
- this.$element.hide().css('width','0px');
+ this.$el.hide().css('width','0px');
}
this.on_hide(this);
},
@@ -136,7 +136,7 @@ function openerp_pos_scrollbar(instance, module){ //module is instance.point_of_
var button_up_height = this.$('.up-button')[0].offsetHeight || 48;
var button_down_height = this.$('.down-button')[0].offsetHeight || 48;
- var bar_height = this.$element[0].offsetHeight || 96;
+ var bar_height = this.$el[0].offsetHeight || 96;
var scrollbar_height = bar_height - button_up_height - button_down_height;
scroller_pos = scroller_pos * scrollbar_height + button_up_height;
@@ -205,7 +205,7 @@ function openerp_pos_scrollbar(instance, module){ //module is instance.point_of_
if(this.target_selector){
return this.target_widget.$(this.target_selector);
}else{
- return this.target_widget.$element;
+ return this.target_widget.$el;
}
}else if(this.target_selector){
return $(this.target_selector);
diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js
index c3bd73ca35a..5b98865a971 100644
--- a/addons/point_of_sale/static/src/js/widgets.js
+++ b/addons/point_of_sale/static/src/js/widgets.js
@@ -61,10 +61,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
start: function() {
this.state.bind('change:mode', this.changedMode, this);
this.changedMode();
- this.$element.find('button#numpad-backspace').click(_.bind(this.clickDeleteLastChar, this));
- this.$element.find('button#numpad-minus').click(_.bind(this.clickSwitchSign, this));
- this.$element.find('button.number-char').click(_.bind(this.clickAppendNewChar, this));
- this.$element.find('button.mode-button').click(_.bind(this.clickChangeMode, this));
+ this.$el.find('button#numpad-backspace').click(_.bind(this.clickDeleteLastChar, this));
+ this.$el.find('button#numpad-minus').click(_.bind(this.clickSwitchSign, this));
+ this.$el.find('button.number-char').click(_.bind(this.clickAppendNewChar, this));
+ this.$el.find('button.mode-button').click(_.bind(this.clickChangeMode, this));
},
clickDeleteLastChar: function() {
return this.state.deleteLastChar();
@@ -84,7 +84,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
changedMode: function() {
var mode = this.state.get('mode');
$('.selected-mode').removeClass('selected-mode');
- $(_.str.sprintf('.mode-button[data-mode="%s"]', mode), this.$element).addClass('selected-mode');
+ $(_.str.sprintf('.mode-button[data-mode="%s"]', mode), this.$el).addClass('selected-mode');
},
});
@@ -102,7 +102,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
pos_widget : self.pos_widget,
cashRegister: cashRegister,
});
- button.appendTo(self.$element);
+ button.appendTo(self.$el);
});
}
});
@@ -117,7 +117,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
var self = this;
this._super();
- this.$element.click(function(){
+ this.$el.click(function(){
if (self.pos.get('selectedOrder').get('screen') === 'receipt'){ //TODO Why ?
console.warn('TODO should not get there...?');
return;
@@ -146,9 +146,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
},
renderElement: function() {
this._super();
- this.$element.click(_.bind(this.click_handler, this));
+ this.$el.click(_.bind(this.click_handler, this));
if(this.model.is_selected()){
- this.$element.addClass('selected');
+ this.$el.addClass('selected');
}
},
refresh: function(){
@@ -291,7 +291,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this._super();
this.$('img').replaceWith(this.pos_widget.image_cache.get_image(this.get_image_url()));
var self = this;
- $("a", this.$element).click(function(e){
+ $("a", this.$el).click(function(e){
if(self.click_product_action){
self.click_product_action(self.model);
}
@@ -355,7 +355,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
},
setButtonSelected: function() {
$('.selected-order').removeClass('selected-order');
- this.$element.addClass('selected-order');
+ this.$el.addClass('selected-order');
},
closeOrder: function(event) {
this.order.destroy();
@@ -378,7 +378,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
renderElement: function(){
this._super();
if(this.click_action){
- this.$element.click(_.bind(this.click_action, this));
+ this.$el.click(_.bind(this.click_action, this));
}
},
});
@@ -421,10 +421,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
return button;
},
show:function(){
- this.$element.show();
+ this.$el.show();
},
hide:function(){
- this.$element.hide();
+ this.$el.hide();
},
});
@@ -644,11 +644,11 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
var self = this;
this._super();
if(this.action){
- this.$element.click(function(){ self.action(); });
+ this.$el.click(function(){ self.action(); });
}
},
- show: function(){ this.$element.show(); },
- hide: function(){ this.$element.hide(); },
+ show: function(){ this.$el.show(); },
+ hide: function(){ this.$el.hide(); },
});
diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js
index c8250edcafd..194cc186f27 100644
--- a/addons/project/static/src/js/project.js
+++ b/addons/project/static/src/js/project.js
@@ -10,7 +10,7 @@ openerp.project = function(openerp) {
var members_ids = [];
// Collect members ids
- self.$element.find('img[data-member_id]').each(function() {
+ self.$el.find('img[data-member_id]').each(function() {
members_ids.push($(this).data('member_id'));
});
@@ -19,7 +19,7 @@ openerp.project = function(openerp) {
dataset.read_slice(['id', 'name']).then(function(result) {
_.each(result, function(v, k) {
// Set the proper value in the DOM
- self.$element.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tipsy({
+ self.$el.find('img[data-member_id=' + v.id + ']').attr('title', v.name).tipsy({
offset: 10
});
});
@@ -35,7 +35,7 @@ openerp.project = 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'));
});
@@ -44,7 +44,7 @@ openerp.project = 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/share/static/src/js/share.js b/addons/share/static/src/js/share.js
index 6cc12a5bfa8..bab3cac243f 100644
--- a/addons/share/static/src/js/share.js
+++ b/addons/share/static/src/js/share.js
@@ -89,7 +89,7 @@ openerp.share = function(session) {
start: function() {
start_res = this._super.apply(this, arguments);
if (has_action_id) {
- this.$element.find('button.oe_share_invite').show();
+ this.$el.find('button.oe_share_invite').show();
}
return start_res;
}
@@ -100,7 +100,7 @@ openerp.share = function(session) {
var self = this;
this.check_if_action_is_defined();
has_share(function() {
- self.$element.delegate('button.oe_share_invite', 'click', self.on_click_share_invite);
+ self.$el.delegate('button.oe_share_invite', 'click', self.on_click_share_invite);
});
return this._super.apply(this, arguments);
},
diff --git a/addons/web_linkedin/__openerp__.py b/addons/web_linkedin/__openerp__.py
index 0e9503ac579..6ce78cfca47 100644
--- a/addons/web_linkedin/__openerp__.py
+++ b/addons/web_linkedin/__openerp__.py
@@ -10,7 +10,7 @@ OpenERP Web LinkedIn module.
This module provides the Integration of the LinkedIn with OpenERP.
""",
'data': ['web_linkedin_view.xml'],
- 'depends' : ['base'],
+ 'depends' : ['crm'],
'js': ['static/src/js/*.js'],
'css': ['static/src/css/*.css'],
'qweb': ['static/src/xml/*.xml'],
diff --git a/addons/web_linkedin/static/src/js/linkedin.js b/addons/web_linkedin/static/src/js/linkedin.js
index f0befb9e6ac..8f6a2b096a5 100644
--- a/addons/web_linkedin/static/src/js/linkedin.js
+++ b/addons/web_linkedin/static/src/js/linkedin.js
@@ -233,8 +233,8 @@ openerp.web_linkedin = function(instance) {
$row.appendTo($elem);
}
pc.appendTo($row);
- pc.$element.css("display", "table-cell");
- pc.$element.css("width", "20%");
+ pc.$el.css("display", "table-cell");
+ pc.$el.css("width", "20%");
pc.on("selected", self, function(data) {
self.trigger("selected", data);
self.destroy();
@@ -255,7 +255,7 @@ openerp.web_linkedin = function(instance) {
},
start: function() {
var self = this;
- this.$element.click(function() {
+ this.$el.click(function() {
self.trigger("selected", self.data);
});
if (this.data.__type === "company") {
diff --git a/addons/web_linkedin/web_linkedin.py b/addons/web_linkedin/web_linkedin.py
index c398ad17f3b..ea94329f8b1 100644
--- a/addons/web_linkedin/web_linkedin.py
+++ b/addons/web_linkedin/web_linkedin.py
@@ -39,8 +39,7 @@ class Binary(openerpweb.Controller):
return base64.b64encode(bfile.read())
class web_linkedin_settings(osv.osv_memory):
- _name = 'web_linkedin.settings'
- _inherit = 'res.config.settings'
+ _inherit = 'sale.config.settings'
_columns = {
'api_key': fields.char(string="API Key", size=50),
'server_domain': fields.char(size=100),
diff --git a/addons/web_linkedin/web_linkedin_view.xml b/addons/web_linkedin/web_linkedin_view.xml
index 463bfd49d21..8b4fa617bf3 100644
--- a/addons/web_linkedin/web_linkedin_view.xml
+++ b/addons/web_linkedin/web_linkedin_view.xml
@@ -15,48 +15,34 @@
linkedin_settings
- web_linkedin.settings
+ sale.config.settings
+
-
+
-
-
- Configure Linkedin
- ir.actions.act_window
- web_linkedin.settings
- form
- inline
-
-
-
-
diff --git a/addons/web_shortcuts/static/src/js/web_shortcuts.js b/addons/web_shortcuts/static/src/js/web_shortcuts.js
index a2d0fe43596..743f3fc73aa 100644
--- a/addons/web_shortcuts/static/src/js/web_shortcuts.js
+++ b/addons/web_shortcuts/static/src/js/web_shortcuts.js
@@ -39,13 +39,13 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
var self = this;
this._super();
this.trigger('load');
- this.$element.on('click', '.oe_systray_shortcuts_items a', function() {
+ this.$el.on('click', '.oe_systray_shortcuts_items a', function() {
self.trigger('click', $(this));
});
},
load: function() {
var self = this;
- this.$element.find('.oe_systray_shortcuts_items').empty();
+ this.$el.find('.oe_systray_shortcuts_items').empty();
return this.rpc('/web/shortcuts/list', {}, function(shortcuts) {
_.each(shortcuts, function(sc) {
self.trigger('display', sc);
@@ -64,13 +64,13 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
},
display: function(sc) {
var self = this;
- this.$element.find('.oe_systray_shortcuts_items').append();
+ this.$el.find('.oe_systray_shortcuts_items').append();
var $sc = $(QWeb.render('Systray.Shortcuts.Item', {'shortcut': sc}));
- $sc.appendTo(self.$element.find('.oe_systray_shortcuts_items'));
+ $sc.appendTo(self.$el.find('.oe_systray_shortcuts_items'));
},
remove: function (menu_id) {
var menu_id = this.session.active_id;
- var $shortcut = this.$element.find('.oe_systray_shortcuts_items li a[data-id=' + menu_id + ']');
+ var $shortcut = this.$el.find('.oe_systray_shortcuts_items li a[data-id=' + menu_id + ']');
var shortcut_id = $shortcut.data('shortcut-id');
$shortcut.remove();
this.dataset.unlink([shortcut_id]);
@@ -85,10 +85,10 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
instance.webclient.user_menu.on_action({action_id: ir_menu_data.action[0][2].id});
}
});
- this.$element.find('.oe_systray_shortcuts').trigger('mouseout');
+ this.$el.find('.oe_systray_shortcuts').trigger('mouseout');
},
has: function(menu_id) {
- return !!this.$element.find('a[data-id=' + menu_id + ']').length;
+ return !!this.$el.find('a[data-id=' + menu_id + ']').length;
}
});
@@ -101,7 +101,7 @@ instance.web.UserMenu.include({
self.shortcuts.trigger('load');
} else {
self.shortcuts = new instance.web_shortcuts.Shortcuts(self);
- self.shortcuts.appendTo(instance.webclient.$element.find('.oe_systray'));
+ self.shortcuts.appendTo(instance.webclient.$el.find('.oe_systray'));
}
});
},
@@ -119,7 +119,7 @@ instance.web.ViewManagerAction.include({
var shortcuts_menu = instance.webclient.user_menu.shortcuts;
var grandparent = this.getParent() && this.getParent().getParent();
// display shortcuts if on the first view for the action
- var $shortcut_toggle = this.$element.find('.oe_shortcuts_toggle');
+ var $shortcut_toggle = this.$el.find('.oe_shortcuts_toggle');
if (!this.action.name ||
!(view.view_type === this.views_src[0].view_type
&& view.view_id === this.views_src[0].view_id)) {