Customization of form - conditional display

Dear all,
As I have started to know better ERPnext and use more effectively, I thought it was time that I customise it for our agricultural purpose.

So I started with “Item”
and here are my 3 questions.

1> If item-group is of type “Fertiliser” OR “Insecticide”, I want to display “Type of application” with 2 possible values (“Foliar” or “Drench”)
I know how to do this if it is only for one group_item, but how about the “OR” condition?
eval:doc.item_group==“Fertiliser” OR “Insecticide”
That didn’t really work.

2> Can we make Column break conditional to the item-group?
If item group == “insecticide” I want to 2 columns, otherwise just 2.

3> How can I write this condition:
If group item is “Fertilizer” or “Insecticide”, then let’s NOT display these fields.

I’m on FrappeCloud.

4> Any time frame on when we will be able to add our own form into our ERPnext instance (I’m on FrappeCloud)? I’d love to start working on an agro-chemicals application form.

Thanks in advance for all your suggestion.

François

  1. Use:
eval:doc.item_group=="Fertiliser" || doc.item_group=="Insecticide" 
eval:!(doc.item_group=="Fertiliser" || doc.item_group=="Insecticide")

Thats do-able… Keep bugging us on GitHub issues :smile:

2 Likes

Thanks a lot. Very useful. Any suggestion on where I can learn that syntax and tricks?

Subimitted on Github:
https://github.com/frappe/erpnext/issues/2282

Thanks for your consideration.

Best,

François

I need to do something like that but validate on a field in another doctype
like: purchase receipt item table and this field display depend on company field in purchase receipt doctype
How can I do that?
Thanks for help