[MERGE] forward port branch 10.0 up to 22eb3ee971

This commit is contained in:
Christophe Simonis
2017-08-28 12:13:05 +02:00
10 changed files with 54 additions and 9 deletions
@@ -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;
}
}
}
}
@@ -507,6 +507,7 @@
<form string="Contribution">
<group>
<field name="name"/>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" class="oe_inline"/>
</group>
<newline/>
@@ -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;
+1 -1
View File
@@ -57,7 +57,7 @@ class ReportProjectTaskUser(models.Model):
t.partner_id,
t.stage_id as stage_id,
t.kanban_state as state,
(extract('epoch' from (t.write_date-t.create_date)))/(3600*24) as closing_days,
(extract('epoch' from (NULLIF(t.date_end, t.write_date)-t.create_date)))/(3600*24) as closing_days,
(extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
(extract('epoch' from (t.date_deadline-(now() at time zone 'UTC'))))/(3600*24) as delay_endings_days
"""
+1 -1
View File
@@ -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,
+6 -1
View File
@@ -117,7 +117,12 @@
<span t-if="pack_operation.package_id">:</span>
<span t-field="pack_operation.package_id"/>
<span t-field="pack_operation.ordered_qty"/>
<span t-field="pack_operation.product_uom_id"/>
<t t-if="pack_operation.linked_move_operation_ids">
<span t-field="pack_operation.linked_move_operation_ids[0].move_id.product_uom"></span>
</t>
<t t-else="1">
<span t-field="pack_operation.product_uom_id"></span>
</t>
</td>
<td class="text-right" t-if="pack_operation.state == 'done'">
<t t-if="pack_operation.ordered_qty != pack_operation.qty_done">
+12 -1
View File
@@ -715,7 +715,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);
},
@@ -754,10 +754,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 = "";
+11
View File
@@ -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