Get_item_details in server scripting

After server scripting feature, is it possible to set default value of item qty on sales invoice to zero or blank instead of 1.

Hi @zulfi007,

That’s a great question. No, I do not think it’s possible, using server-side code.

I recently investigated this. I was hoping to discover a initial_values() or default_values() Python hook I could use. Something that would change the defaults, under specific circumstances.

However, I found nothing like this.

My impression was the JavaScript code fetches the default values -directly- from the DocType’s metadata. If the DocType default = 1, that becomes the value in the JS/Python objects, prior to saving in SQL.

This would be an excellent feature, though.

1 Like