This commit is contained in:
2026-01-17 09:25:00 +01:00
parent 660e714983
commit 9c6029d152
2 changed files with 23 additions and 1 deletions

View File

@@ -367,7 +367,21 @@ class Fee(ModelSQL,ModelView):
p.currency = record.currency
p.line_type = 'service'
Purchase.save([p])
#if reception of moves done we need to generate accrual for fee
StockMove = Pool().get('stock.move')
feelots = FeeLots.search(['fee','=',record.id])
for lot in feelots:
move = lot.get_received_move()
if move:
Warning = Pool().get('res.user.warning')
warning_name = Warning.format("Lot ever received", [])
if Warning.check(warning_name):
raise Warning(warning_name,
"By clicking yes, an accrual for this fee will be created")
AccountMove = Pool().get('account.move')
account_move = move._get_account_stock_move_fee(record.id)
AccountMove.save([account_move])
return records
class FeeLots(ModelSQL,ModelView):