Landed Cost Voucher — distribute cost by weight (ERPNext v15)

Hi everyone,

I’m using ERPNext v15 and would like to distribute landed costs (e.g. freight or duty) based on item weight instead of only quantity or amount.

I can’t find “Weight” as an option in the Distribute Charges Based On field of the Landed Cost Voucher.

Has anyone implemented or customized this feature before (perhaps via a custom app or server script)?

Any pointers, sample code that would be very helpful.

Thanks in advance!