frappe.model.set_value in a loop triggered ERPNext pricing recalculation per item,
causing values to be overwritten. Now sets values on locals objects directly and
triggers a single recalculation at the end.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>