Browse Source

[IMP] Restore lot information in '_prepare_orderlines_from_order_data'

pull/467/head
Iván Todorovich 5 years ago
parent
commit
ff281e4811
  1. 24
      pos_order_mgmt/static/src/js/widgets.js

24
pos_order_mgmt/static/src/js/widgets.js

@ -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);
}
}
} }
}); });
}, },

Loading…
Cancel
Save