main #7

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

View File

@@ -464,35 +464,35 @@ class Fee(ModelSQL,ModelView):
# FeeLots.save([fl]) # FeeLots.save([fl])
# qt_line += l.get_current_quantity_converted() # qt_line += l.get_current_quantity_converted()
# 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 == 'virtual' and len(fee.sale_line.lots)==1) or (l.lot_type == 'physic' and len(fee.sale_line.lots)>1): # 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
fl.sale_line = l.sale_line.id # fl.sale_line = l.sale_line.id
FeeLots.save([fl]) # FeeLots.save([fl])
qt_line += l.get_current_quantity_converted() # qt_line += l.get_current_quantity_converted()
unit = l.sale_line.unit # unit = l.sale_line.unit
if fee.shipment_in: # if fee.shipment_in:
if fee.shipment_in.state == 'draft'or fee.shipment_in.state == 'started': # if fee.shipment_in.state == 'draft'or fee.shipment_in.state == 'started':
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:
fl = FeeLots() # fl = FeeLots()
fl.fee = fee.id # fl.fee = fee.id
fl.lot = l.id # fl.lot = l.id
FeeLots.save([fl]) # FeeLots.save([fl])
qt_sh += l.get_current_quantity_converted() # qt_sh += l.get_current_quantity_converted()
unit = l.line.unit # unit = l.line.unit
else: # else:
lqts = LotQt.search(['lot_shipment_in','=',fee.shipment_in.id]) # lqts = LotQt.search(['lot_shipment_in','=',fee.shipment_in.id])
if lqts: # if lqts:
for l in lqts: # for l in lqts:
qt_sh += l.lot_p.get_current_quantity_converted() # qt_sh += l.lot_p.get_current_quantity_converted()
unit = l.lot_p.line.unit # unit = l.lot_p.line.unit
else: # else:
raise UserError("You cannot add fee on received shipment!") # raise UserError("You cannot add fee on received shipment!")
type = fee.type type = fee.type
if type == 'ordered': if type == 'ordered':