Skip to content

Commit

Permalink
[Karthi] | Live | Refactor. Lot choose by location issue fixed via api (
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyansp91 authored Apr 1, 2024
1 parent 2f179c3 commit 9fb2b9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bahmni_sale/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ def get_available_batch_details(self, product_id, sale_order):
sale_order = self.env['sale.order'].browse(sale_order)
context['location_id'] = sale_order.location_id and sale_order.location_id.id or False
context['search_in_child'] = True
shop_location_id = sale_order.shop_id.location_id.id if sale_order.shop_id.location_id.id else self.order_id.shop_id.location_id.id
stock_quant_lot = self.env['stock.quant'].search([
('product_id','=', product_id.id if type(product_id) != list else product_id[0]),
('location_id', '=', self.order_id.shop_id.location_id.id),
('location_id', '=', shop_location_id),
('quantity', '>' , 0)])
stock_prod_lot = self.env['stock.lot'].search([('id', 'in', [lot_id.lot_id.id for lot_id in stock_quant_lot])])
already_used_batch_ids = []
Expand Down

0 comments on commit 9fb2b9c

Please sign in to comment.