[MERGE] forward port branch saas-6 up to 7bcfa2b52a
This commit is contained in:
@@ -2429,6 +2429,7 @@ class stock_move(osv.osv):
|
|||||||
main_domain = {}
|
main_domain = {}
|
||||||
todo_moves = []
|
todo_moves = []
|
||||||
operations = set()
|
operations = set()
|
||||||
|
ancestors_list = {}
|
||||||
self.do_unreserve(cr, uid, [x.id for x in self.browse(cr, uid, ids, context=context) if x.reserved_quant_ids and x.state in ['confirmed', 'waiting', 'assigned']], context=context)
|
self.do_unreserve(cr, uid, [x.id for x in self.browse(cr, uid, ids, context=context) if x.reserved_quant_ids and x.state in ['confirmed', 'waiting', 'assigned']], context=context)
|
||||||
for move in self.browse(cr, uid, ids, context=context):
|
for move in self.browse(cr, uid, ids, context=context):
|
||||||
if move.state not in ('confirmed', 'waiting', 'assigned'):
|
if move.state not in ('confirmed', 'waiting', 'assigned'):
|
||||||
@@ -2449,6 +2450,7 @@ class stock_move(osv.osv):
|
|||||||
|
|
||||||
#if the move is preceeded, restrict the choice of quants in the ones moved previously in original move
|
#if the move is preceeded, restrict the choice of quants in the ones moved previously in original move
|
||||||
ancestors = self.find_move_ancestors(cr, uid, move, context=context)
|
ancestors = self.find_move_ancestors(cr, uid, move, context=context)
|
||||||
|
ancestors_list[move.id] = True if ancestors else False
|
||||||
if move.state == 'waiting' and not ancestors:
|
if move.state == 'waiting' and not ancestors:
|
||||||
#if the waiting move hasn't yet any ancestor (PO/MO not confirmed yet), don't find any quant available in stock
|
#if the waiting move hasn't yet any ancestor (PO/MO not confirmed yet), don't find any quant available in stock
|
||||||
main_domain[move.id] += [('id', '=', False)]
|
main_domain[move.id] += [('id', '=', False)]
|
||||||
@@ -2491,6 +2493,10 @@ class stock_move(osv.osv):
|
|||||||
lot_qty[lot] -= qty
|
lot_qty[lot] -= qty
|
||||||
move_qty -= qty
|
move_qty -= qty
|
||||||
|
|
||||||
|
|
||||||
|
# Sort moves to reserve first the ones with ancestors, in case the same product is listed in
|
||||||
|
# different stock moves.
|
||||||
|
todo_moves.sort(key=lambda x: -1 if ancestors_list.get(x.id) else 0)
|
||||||
for move in todo_moves:
|
for move in todo_moves:
|
||||||
#then if the move isn't totally assigned, try to find quants without any specific domain
|
#then if the move isn't totally assigned, try to find quants without any specific domain
|
||||||
if (move.state != 'assigned') and not context.get("reserve_only_ops"):
|
if (move.state != 'assigned') and not context.get("reserve_only_ops"):
|
||||||
|
|||||||
@@ -852,6 +852,7 @@ function eval_domains (domains, evaluation_context) {
|
|||||||
var result_domain = [];
|
var result_domain = [];
|
||||||
// Normalize only if the first domain is the array ["|"] or ["!"]
|
// Normalize only if the first domain is the array ["|"] or ["!"]
|
||||||
var need_normalization = (
|
var need_normalization = (
|
||||||
|
domains &&
|
||||||
domains.length > 0 &&
|
domains.length > 0 &&
|
||||||
domains[0].length === 1 &&
|
domains[0].length === 1 &&
|
||||||
(domains[0][0] === "|" || domains[0][0] === "!")
|
(domains[0][0] === "|" || domains[0][0] === "!")
|
||||||
|
|||||||
@@ -1027,9 +1027,11 @@ ListView.List = Class.extend( /** @lends instance.web.ListView.List# */{
|
|||||||
'[data-id=' + record.get('id') + ']');
|
'[data-id=' + record.get('id') + ']');
|
||||||
}
|
}
|
||||||
|
|
||||||
var $newRow = $(self.render_record(record));
|
if ($row.length) {
|
||||||
$newRow.find('.oe_list_record_selector input').prop('checked', !!$row.find('.oe_list_record_selector input').prop('checked'));
|
var $newRow = $(self.render_record(record));
|
||||||
$row.replaceWith($newRow);
|
$newRow.find('.oe_list_record_selector input').prop('checked', !!$row.find('.oe_list_record_selector input').prop('checked'));
|
||||||
|
$row.replaceWith($newRow);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'add': function (ev, records, record, index) {
|
'add': function (ev, records, record, index) {
|
||||||
var $new_row = $(self.render_record(record));
|
var $new_row = $(self.render_record(record));
|
||||||
|
|||||||
Reference in New Issue
Block a user