main #7

Merged
admin merged 620 commits from main into dev 2026-03-29 13:03:25 +00:00
Showing only changes of commit 0047e6e879 - Show all commits

View File

@@ -307,7 +307,7 @@ class Fee(ModelSQL,ModelView):
LotQt = Pool().get('lot.qt')
if fee.line:
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.fee = fee.id
fl.lot = l.id
@@ -317,7 +317,7 @@ class Fee(ModelSQL,ModelView):
unit = l.line.unit
if fee.sale_line:
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.fee = fee.id
fl.lot = l.id
@@ -330,7 +330,6 @@ class Fee(ModelSQL,ModelView):
lots = Lots.search(['lot_shipment_in','=',fee.shipment_in.id])
if lots:
for l in lots:
#if l.lot_type == 'physic':
fl = FeeLots()
fl.fee = fee.id
fl.lot = l.id
@@ -360,7 +359,9 @@ class Fee(ModelSQL,ModelView):
pl.unit = unit
pl.fee_ = fee.id
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.lines = [pl]
p.party = fee.supplier