16.01.26
This commit is contained in:
@@ -1990,8 +1990,7 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
'''
|
||||
pool = Pool()
|
||||
Move = pool.get('stock.move')
|
||||
InvoiceLine = pool.get('account.invoice.line')
|
||||
Uom = pool.get('product.uom')
|
||||
Location = pool.get('stock.location')
|
||||
if self.type != 'line':
|
||||
return
|
||||
if not self.product:
|
||||
@@ -2049,24 +2048,24 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
move.from_location = from_location
|
||||
|
||||
if to_location.type != 'customer':
|
||||
move.to_location = 8
|
||||
move.to_location = Location.get_transit_id()
|
||||
else:
|
||||
move.to_location = to_location
|
||||
|
||||
unit_price = l.get_lot_price()
|
||||
if l.invoice_line_prov != None :
|
||||
prov_inv = InvoiceLine(l.invoice_line_prov)
|
||||
quantity -= prov_inv.quantity
|
||||
if quantity < 0 :
|
||||
move.from_location = self.purchase.to_location
|
||||
move.to_location = 16
|
||||
elif quantity > 0 :
|
||||
move.from_location = 16
|
||||
move.to_location = self.purchase.to_location
|
||||
quantity = abs(quantity)
|
||||
unit_price = prov_inv.unit_price
|
||||
if quantity == 0:
|
||||
continue
|
||||
# if l.invoice_line_prov != None :
|
||||
# prov_inv = InvoiceLine(l.invoice_line_prov)
|
||||
# quantity -= prov_inv.quantity
|
||||
# if quantity < 0 :
|
||||
# move.from_location = self.purchase.to_location
|
||||
# move.to_location = 16
|
||||
# elif quantity > 0 :
|
||||
# move.from_location = 16
|
||||
# move.to_location = self.purchase.to_location
|
||||
# quantity = abs(quantity)
|
||||
# unit_price = prov_inv.unit_price
|
||||
# if quantity == 0:
|
||||
# continue
|
||||
move.quantity = quantity
|
||||
move.unit = self.unit
|
||||
move.product = l.lot_product
|
||||
@@ -2086,7 +2085,7 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
moves.append(move)
|
||||
if move.to_location.type != 'customer':
|
||||
move_to, = Move.copy([move.id], default={
|
||||
'from_location': 8,
|
||||
'from_location': Location.get_transit_id(),
|
||||
'to_location': to_location,
|
||||
})
|
||||
moves.append(move_to)
|
||||
|
||||
Reference in New Issue
Block a user