[MERGE] forward port of branch 8.0 up to 5d9fb7f
This commit is contained in:
@@ -690,6 +690,8 @@ class sale_order(osv.osv):
|
||||
|
||||
:return: True
|
||||
"""
|
||||
context = dict(context)
|
||||
context['lang'] = self.pool['res.users'].browse(cr, uid, uid).lang
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
sale_line_obj = self.pool.get('sale.order.line')
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-xs-offset-1">
|
||||
<div t-if="o.move_lines[0].partner_id and o.move_lines[0].partner_id.id != o.partner_id.id">
|
||||
<div t-if="o.move_lines and o.move_lines[0].partner_id and o.move_lines[0].partner_id.id != o.partner_id.id">
|
||||
<span><strong>Delivery Address:</strong></span>
|
||||
<div t-field="o.move_lines[0].partner_id"
|
||||
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
|
||||
</div>
|
||||
<div t-if="o.picking_type_id.code != 'internal' and (not o.move_lines[0].partner_id) and o.picking_type_id.warehouse_id.partner_id">
|
||||
<div t-if="o.picking_type_id.code != 'internal' and (not o.move_lines or not o.move_lines[0].partner_id) and o.picking_type_id.warehouse_id.partner_id">
|
||||
<span><strong>Warehouse Address:</strong></span>
|
||||
<div t-field="o.picking_type_id.warehouse_id.partner_id"
|
||||
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
|
||||
|
||||
@@ -1128,10 +1128,11 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
||||
new instance.web.Dialog(this, { title: _t("Warning"), size: 'medium',}, $("<div />").text(_t("You must choose at least one record."))).open();
|
||||
return false;
|
||||
}
|
||||
var dataset = self.getParent().dataset;
|
||||
var active_ids_context = {
|
||||
active_id: ids[0],
|
||||
active_ids: ids,
|
||||
active_model: self.getParent().dataset.model,
|
||||
active_model: dataset.model,
|
||||
};
|
||||
|
||||
$.when(domain).done(function (domain) {
|
||||
@@ -1145,7 +1146,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
|
||||
self.rpc("/web/action/load", {
|
||||
action_id: item.action.id,
|
||||
context: new instance.web.CompoundContext(
|
||||
self.dataset.get_context(), active_ids_context).eval()
|
||||
dataset.get_context(), active_ids_context).eval()
|
||||
}).done(function(result) {
|
||||
result.context = new instance.web.CompoundContext(
|
||||
result.context || {}, active_ids_context)
|
||||
|
||||
@@ -146,8 +146,6 @@ class TestOnChange(common.TransactionCase):
|
||||
}),
|
||||
(1, message.id, {
|
||||
'name': "[%s] %s" % ("Foo", USER.name),
|
||||
# Note: size is computed because it was not provided beforehand
|
||||
'size': len(BODY),
|
||||
}),
|
||||
])
|
||||
|
||||
|
||||
@@ -5793,6 +5793,11 @@ class BaseModel(object):
|
||||
# attach `self` with a different context (for cache consistency)
|
||||
record._origin = self.with_context(__onchange=True)
|
||||
|
||||
# load fields on secondary records, to avoid false changes
|
||||
with env.do_in_onchange():
|
||||
for field_seq in secondary:
|
||||
record.mapped(field_seq)
|
||||
|
||||
# determine which field(s) should be triggered an onchange
|
||||
todo = list(names) or list(values)
|
||||
done = set()
|
||||
|
||||
Reference in New Issue
Block a user