[FIX] *: correct previous forward port

Due to files renaming, some patched should be applied manually to the
correct files.
Forgot to `git add` these files when committing the forward port...
This commit is contained in:
Christophe Simonis
2015-04-17 17:08:17 +02:00
parent a9471c43b9
commit 107b589a11
7 changed files with 33 additions and 19 deletions
+1 -1
View File
@@ -1807,7 +1807,7 @@ var ReconciliationListView = ListView.extend({
this.last_group_by = group_by;
this.old_search = _.bind(this._super, this);
var mod = new Model("account.move.line", context, domain);
return mod.call("list_partners_to_reconcile", []).then(function(result) {
return mod.call("list_partners_to_reconcile", [context, domain]).then(function(result) {
var current = self.current_partner !== null ? self.partners[self.current_partner][0] : null;
self.partners = result;
var index = _.find(_.range(self.partners.length), function(el) {
@@ -136,10 +136,6 @@ function parse_value (value, descriptor, value_if_empty) {
return tmp;
case 'monetary':
case 'float':
tmp = Number(value);
if (!isNaN(tmp))
return tmp;
var tmp2 = value;
do {
tmp = tmp2;
+6 -3
View File
@@ -297,9 +297,12 @@ var PropertiesMixin = _.extend({}, EventDispatcherMixin, {
// this also has the side effect of introducing a dependency on utils. Todo:
// remove this, or move it elsewhere. Also, learn OO programming.
if (key === 'value' && self.field && self.field.type === 'float' && tmp && val){
var precision = self.field.digits ? self.field.digits[1] : 2;
if (utils.float_is_zero(tmp - val, precision)) {
return;
var digits = self.field.digits;
if (digits !== 0){
digits = digits ? digits[1] : 2;
if (utils.float_is_zero(tmp - val, digits)) {
return;
}
}
}
changed = true;
@@ -4,6 +4,7 @@ odoo.define('web.Session', function (require) {
var ajax = require('web.ajax');
var core = require('web.core');
var utils = require('web.utils');
var Model = require('web.Model');
var _t = core._t;
var qweb = core.qweb;
@@ -41,6 +42,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
// TODO: session store in cookie should be optional
this.qweb_mutex = new utils.Mutex();
this.currencies = {};
this._groups_def = {};
},
setup: function(origin, options) {
// must be able to customize server
@@ -129,6 +131,17 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
$.bbq.removeState();
return this.rpc("/web/session/destroy", {});
},
user_has_group: function(group) {
if (!this.uid) {
return $.when().resolve(false);
}
var def = this._groups_def[group];
if (!def) {
var Users = new Model('res.users');
def = this._groups_def[group] = Users.call('has_group', [group]);
}
return def;
},
get_cookie: function (name) {
if (!this.name) { return null; }
var nameEQ = this.name + '|' + name + '=';
+1 -1
View File
@@ -138,7 +138,7 @@ function json_node_to_xml (node, human_readable, indent) {
cr = human_readable ? '\n' : '';
if (typeof(node) === 'string') {
return sindent + node;
return sindent + node.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
} else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
throw new Error(
_.str.sprintf(_t("Node [%s] is not a JSONified XML node"),
@@ -53,16 +53,18 @@ if (core.debug) {
return;
}
// Render the dropdown and append it
var dropdown_content = QWeb.render('WebClient.DebugDropdown', {
widget: self,
active_view: self.active_view,
view: self.view,
action: self.view_manager.action,
searchview: self.view_manager.searchview,
uid: session.uid,
this.session.user_has_group('base.group_system').then(function(is_admin) {
// Render the dropdown and append it
var dropdown_content = QWeb.render('WebClient.DebugDropdown', {
widget: self,
active_view: self.active_view,
view: self.view,
action: self.view_manager.action,
searchview: self.view_manager.searchview,
is_admin: is_admin,
});
$(dropdown_content).appendTo(self.$dropdown);
});
$(dropdown_content).appendTo(self.$dropdown);
},
/**
* Calls the appropriate callback when clicking on a Debug option
@@ -170,7 +170,7 @@ $('.oe_website_sale').each(function () {
$img.attr("src", "/website/image/product.product/" + $(this).val() + "/image");
});
$(oe_website_sale).on('change', 'input.js_variant_change, select.js_variant_change, ul[data-attribute_value_ids]', function () {
$(oe_website_sale).on('change', 'input.js_variant_change, select.js_variant_change, ul[data-attribute_value_ids]', function (ev) {
var $ul = $(ev.target).closest('ul.js_add_cart_variants');
var $parent = $ul.closest('.js_product');
var $product_id = $parent.find('input.product_id').first();