[MERGE] forward port branch saas-11 up to 428ad2dfe3
This commit is contained in:
@@ -114,6 +114,11 @@
|
||||
.o_kanban_view .o_kanban_record .oe_kanban_list_many2many .o_form_field_many2manytags {
|
||||
border: none;
|
||||
}
|
||||
|
||||
// Override height of graph. min-height doesn't do the trick
|
||||
.o_graph {
|
||||
height: 500px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1428,6 +1428,9 @@ exports.Orderline = Backbone.Model.extend({
|
||||
if (!no_map_tax){
|
||||
tax = self._map_tax_fiscal_position(tax);
|
||||
}
|
||||
if (!tax){
|
||||
return;
|
||||
}
|
||||
if (tax.amount_type === 'group'){
|
||||
var ret = self.compute_all(tax.children_tax_ids, price_unit, quantity, currency_rounding);
|
||||
total_excluded = ret.total_excluded;
|
||||
|
||||
@@ -153,7 +153,7 @@ class ProcurementOrder(models.Model):
|
||||
qty_done = sum(self.move_ids.filtered(lambda move: move.state == 'done').mapped('product_uom_qty'))
|
||||
qty_left = max(self.product_qty - qty_done, 0)
|
||||
return {
|
||||
'name': self.name,
|
||||
'name': self.name[:2000],
|
||||
'company_id': self.rule_id.company_id.id or self.rule_id.location_src_id.company_id.id or self.rule_id.location_id.company_id.id or self.company_id.id,
|
||||
'product_id': self.product_id.id,
|
||||
'product_uom': self.product_uom.id,
|
||||
|
||||
@@ -716,7 +716,7 @@ var AbstractField = FormWidget.extend(FieldInterface, {
|
||||
}
|
||||
},
|
||||
_toggle_label: function() {
|
||||
var empty = this.get('effective_readonly') && this.is_false();
|
||||
var empty = this.get('effective_readonly') && !this.is_set();
|
||||
this.$label.toggleClass('o_form_label_empty', empty).toggleClass('o_form_label_false', this.get('effective_readonly') && this.get('value') === false);
|
||||
this.$el.toggleClass('o_form_field_empty', empty);
|
||||
},
|
||||
@@ -755,10 +755,21 @@ var AbstractField = FormWidget.extend(FieldInterface, {
|
||||
/**
|
||||
* Method useful to implement to ease validity testing. Must return true if the current
|
||||
* value is similar to false in OpenERP.
|
||||
* Used at write time, in particular when the field is required
|
||||
*/
|
||||
is_false: function() {
|
||||
return this.get('value') === false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method called at rendering time to determine if the field should be
|
||||
* displayed (non-empty) or not (empty)
|
||||
* We test the same thing as is_false but with different semantics
|
||||
*/
|
||||
is_set: function() {
|
||||
return !this.is_false();
|
||||
},
|
||||
|
||||
_check_css_flags: function() {
|
||||
var show_translate = (!this.get('effective_readonly') && this.field_manager.get('actual_mode') !== "create");
|
||||
this.$translate.toggleClass('o_translate_active', !!show_translate);
|
||||
|
||||
@@ -346,8 +346,8 @@ var FieldMany2One = common.AbstractField.extend(common.CompletionFieldMixin, com
|
||||
if (!this.get("effective_readonly")) {
|
||||
this.$input.val(noValue ? "" : (str.split("\n")[0].trim() || $(data.noDisplayContent).text()));
|
||||
this.current_display = this.$input.val();
|
||||
this.$follow_button.toggle(!this.is_false());
|
||||
this.$el.toggleClass('o_with_button', !!this.$follow_button && this.$follow_button.length > 0 && !this.is_false());
|
||||
this.$follow_button.toggle(this.is_set());
|
||||
this.$el.toggleClass('o_with_button', !!this.$follow_button && this.$follow_button.length > 0 && this.is_set());
|
||||
} else {
|
||||
this.$el.html(noValue ? "" : (_.escape(str.trim()).split("\n").join("<br/>") || data.noDisplayContent));
|
||||
// Define callback to perform when clicking on the field
|
||||
@@ -872,6 +872,10 @@ var FieldX2Many = AbstractManyField.extend({
|
||||
is_false: function() {
|
||||
return _(this.dataset.ids).isEmpty();
|
||||
},
|
||||
is_set: function() {
|
||||
// always consider that field is "set" hence displayed
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
var X2ManyDataSet = data.BufferedDataSet.extend({
|
||||
@@ -1718,6 +1722,10 @@ var FieldMany2ManyCheckBoxes = AbstractManyField.extend(common.ReinitializeField
|
||||
is_false: function() {
|
||||
return false;
|
||||
},
|
||||
is_set: function() {
|
||||
// always consider that field is "set" hence displayed
|
||||
return true;
|
||||
},
|
||||
});
|
||||
|
||||
core.form_widget_registry
|
||||
|
||||
@@ -65,9 +65,10 @@ var KanbanColumn = Widget.extend({
|
||||
});
|
||||
|
||||
var self = this;
|
||||
if (group_data.options && group_data.options.group_by_tooltip) {
|
||||
this.tooltip_info = _.map(group_data.options.group_by_tooltip, function (key, value, list) {
|
||||
return (self.values && self.values[value] && "<div>" +key + "<br>" + self.values[value] + "</div>") || '';
|
||||
if (group_data.options && group_data.options.group_by_tooltip && this.values) {
|
||||
this.tooltip_info = _.map(group_data.options.group_by_tooltip, function (key, value) {
|
||||
if (!self.values[value]) { return ''; }
|
||||
return $('<div>').text(key + '<br>' + self.values[value]).text();
|
||||
}).join('');
|
||||
} else {
|
||||
this.tooltip_info = "";
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Vietnam, 2017-08-24
|
||||
|
||||
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||
Agreement v1.0.
|
||||
|
||||
I declare that I am authorized and able to make this agreement and sign this
|
||||
declaration.
|
||||
|
||||
Signed,
|
||||
|
||||
Do Vuong Tien tiendv@trobz.com https://github.com/vuongtien2411
|
||||
Reference in New Issue
Block a user