|
|
|
@ -273,6 +273,8 @@ async def bulk_update(
|
|
|
|
records_map = {str(record.id): record for record in records}
|
|
|
|
records_map = {str(record.id): record for record in records}
|
|
|
|
records_by_name = {record.name: record for record in records}
|
|
|
|
records_by_name = {record.name: record for record in records}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
run_plant_calculation_change = False
|
|
|
|
|
|
|
|
|
|
|
|
# Process updates in batches
|
|
|
|
# Process updates in batches
|
|
|
|
updated_records = []
|
|
|
|
updated_records = []
|
|
|
|
for masterdata_id, masterdata_in in zip(ids, updates):
|
|
|
|
for masterdata_id, masterdata_in in zip(ids, updates):
|
|
|
|
@ -291,6 +293,8 @@ async def bulk_update(
|
|
|
|
records_by_name=records_by_name,
|
|
|
|
records_by_name=records_by_name,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if run_plant_calculation:
|
|
|
|
|
|
|
|
run_plant_calculation_change = True
|
|
|
|
updated_records.append(masterdata)
|
|
|
|
updated_records.append(masterdata)
|
|
|
|
|
|
|
|
|
|
|
|
print("Updated masterdata:", updated_records)
|
|
|
|
print("Updated masterdata:", updated_records)
|
|
|
|
@ -298,8 +302,7 @@ async def bulk_update(
|
|
|
|
await db_session.commit()
|
|
|
|
await db_session.commit()
|
|
|
|
|
|
|
|
|
|
|
|
await _trigger_masterdata_recalculation(
|
|
|
|
await _trigger_masterdata_recalculation(
|
|
|
|
db_session=db_session,
|
|
|
|
db_session=db_session, run_plant_calculation=run_plant_calculation_change,
|
|
|
|
run_plant_calculation=run_plant_calculation,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
return updated_records
|
|
|
|
return updated_records
|
|
|
|
|