|
@ -210,18 +210,6 @@ odoo.define('pos_order_mgmt.widgets', function (require) { |
|
|
order.trigger('change'); |
|
|
order.trigger('change'); |
|
|
this.pos.get('orders').add(order); |
|
|
this.pos.get('orders').add(order); |
|
|
this.pos.set('selectedOrder', order); |
|
|
this.pos.set('selectedOrder', order); |
|
|
order.get_orderlines().forEach(function (orderline) { |
|
|
|
|
|
if (orderline.pack_lot_lines) |
|
|
|
|
|
{ |
|
|
|
|
|
_.each(orderline.return_pack_lot_names, function(lot_name) { |
|
|
|
|
|
orderline.pack_lot_lines.add(new models.Packlotline( |
|
|
|
|
|
{'lot_name': lot_name}, {'order_line': orderline} |
|
|
|
|
|
)); |
|
|
|
|
|
}) |
|
|
|
|
|
order.save_to_db(); |
|
|
|
|
|
orderline.trigger('change', orderline); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
return order; |
|
|
return order; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -324,6 +312,18 @@ odoo.define('pos_order_mgmt.widgets', function (require) { |
|
|
order.add_product(product, |
|
|
order.add_product(product, |
|
|
self._prepare_product_options_from_orderline_data( |
|
|
self._prepare_product_options_from_orderline_data( |
|
|
order, line, action)); |
|
|
order, line, action)); |
|
|
|
|
|
// Restore lot information.
|
|
|
|
|
|
if (['return'].indexOf(action) !== -1) { |
|
|
|
|
|
var orderline = order.get_selected_orderline() |
|
|
|
|
|
if (orderline.pack_lot_lines) { |
|
|
|
|
|
_.each(orderline.return_pack_lot_names, function(lot_name) { |
|
|
|
|
|
orderline.pack_lot_lines.add(new models.Packlotline( |
|
|
|
|
|
{'lot_name': lot_name}, {'order_line': orderline} |
|
|
|
|
|
)); |
|
|
|
|
|
}) |
|
|
|
|
|
orderline.trigger('change', orderline); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|