17.01.26
This commit is contained in:
@@ -307,7 +307,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
LotQt = Pool().get('lot.qt')
|
LotQt = Pool().get('lot.qt')
|
||||||
if fee.line:
|
if fee.line:
|
||||||
for l in fee.line.lots:
|
for l in fee.line.lots:
|
||||||
#if l.lot_type == 'physic':
|
if (l.lot_type == 'virtual' and len(fee.line.lots)==1) or (l.lot_type == 'physic' and len(fee.line.lots)>1):
|
||||||
fl = FeeLots()
|
fl = FeeLots()
|
||||||
fl.fee = fee.id
|
fl.fee = fee.id
|
||||||
fl.lot = l.id
|
fl.lot = l.id
|
||||||
@@ -317,7 +317,7 @@ class Fee(ModelSQL,ModelView):
|
|||||||
unit = l.line.unit
|
unit = l.line.unit
|
||||||
if fee.sale_line:
|
if fee.sale_line:
|
||||||
for l in fee.sale_line.lots:
|
for l in fee.sale_line.lots:
|
||||||
#if l.lot_type == 'physic':
|
if (l.lot_type == 'virtual' and len(fee.sale_line.lots)==1) or (l.lot_type == 'physic' and len(fee.sale_line.lots)>1):
|
||||||
fl = FeeLots()
|
fl = FeeLots()
|
||||||
fl.fee = fee.id
|
fl.fee = fee.id
|
||||||
fl.lot = l.id
|
fl.lot = l.id
|
||||||
@@ -330,7 +330,6 @@ class Fee(ModelSQL,ModelView):
|
|||||||
lots = Lots.search(['lot_shipment_in','=',fee.shipment_in.id])
|
lots = Lots.search(['lot_shipment_in','=',fee.shipment_in.id])
|
||||||
if lots:
|
if lots:
|
||||||
for l in lots:
|
for l in lots:
|
||||||
#if l.lot_type == 'physic':
|
|
||||||
fl = FeeLots()
|
fl = FeeLots()
|
||||||
fl.fee = fee.id
|
fl.fee = fee.id
|
||||||
fl.lot = l.id
|
fl.lot = l.id
|
||||||
@@ -360,7 +359,9 @@ class Fee(ModelSQL,ModelView):
|
|||||||
pl.unit = unit
|
pl.unit = unit
|
||||||
pl.fee_ = fee.id
|
pl.fee_ = fee.id
|
||||||
if fee.price:
|
if fee.price:
|
||||||
pl.unit_price = round(Decimal(fee.get_price_per_qt()),4)
|
fee_price = fee.get_price_per_qt()
|
||||||
|
logger.info("GET_FEE_PRICE_PER_QT:%s",fee_price)
|
||||||
|
pl.unit_price = round(Decimal(fee_price),4)
|
||||||
p = Purchase()
|
p = Purchase()
|
||||||
p.lines = [pl]
|
p.lines = [pl]
|
||||||
p.party = fee.supplier
|
p.party = fee.supplier
|
||||||
|
|||||||
Reference in New Issue
Block a user