Store the options for child item?

Hi guys, 

So i have these custom Doctypes caledl Rule and Rule Item
Each Rule determine what values Rule Item can select for their param.

For example: 
Rule A say Age is 20,30,40,50. Rule B say Age is 10,15,18.
A Rule A item can only select within [20,30,40,50] and A Rule B Item can only select within [10, 15, 18]

This part of limiting the options i can do using client script to refresh the field. 
But to store the Age array in Rule, there is no array field. Should I just use the serialized string '20,30,40,50' or should I do sth else ? 

Thing is it can get complicated in that case, like I need a age range so [10-20,20-30] then some I need the >=10 <20 but >20 <=30. @@



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1dba3e55-461d-49f4-b2e7-1d1d9cf33368%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Show the code :)


On 03-Sep-2014, at 2:53 pm, Nguyen Do Le Bao <na...@gmail.com> wrote:

Hi guys, 

So i have these custom Doctypes caledl Rule and Rule Item
Each Rule determine what values Rule Item can select for their param.

For example: 
Rule A say Age is 20,30,40,50. Rule B say Age is 10,15,18.
A Rule A item can only select within [20,30,40,50] and A Rule B Item can only select within [10, 15, 18]

This part of limiting the options i can do using client script to refresh the field. 
But to store the Age array in Rule, there is no array field. Should I just use the serialized string '20,30,40,50' or should I do sth else ? 

Thing is it can get complicated in that case, like I need a age range so [10-20,20-30] then some I need the >=10 <20 but >20 <=30. @@




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1dba3e55-461d-49f4-b2e7-1d1d9cf33368%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CF5E2037-ECC6-47B6-86C5-4C6111975070%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
There is no code per se. 
It's more of a question on how to use the Doctype and Field. 


Take a look at this image

So I have a RuleSet Doctype, which include a bunch of Rule (as this row above here)
My rules depend on a Salary Range and a Age Range. But the ranges' options by itself are the same for all the rule in a RuleSet
(For example: I have 3 age ranges [below 50,  50-55 and 55 and above])

Is there a way to model the Doctype so that I don't need to repeat the process of entering the above fields for every row. 
Should I create a Doctype for Salary Range and Age Range ???

Thanks




On Wednesday, September 3, 2014 5:40:43 PM UTC+8, rushabh wrote:
Show the code :)


On 03-Sep-2014, at 2:53 pm, Nguyen Do Le Bao <na...@gmail.com> wrote:

Hi guys, 

So i have these custom Doctypes caledl Rule and Rule Item
Each Rule determine what values Rule Item can select for their param.

For example: 
Rule A say Age is 20,30,40,50. Rule B say Age is 10,15,18.
A Rule A item can only select within [20,30,40,50] and A Rule B Item can only select within [10, 15, 18]

This part of limiting the options i can do using client script to refresh the field. 
But to store the Age array in Rule, there is no array field. Should I just use the serialized string '20,30,40,50' or should I do sth else ? 

Thing is it can get complicated in that case, like I need a age range so [10-20,20-30] then some I need the >=10 <20 but >20 <=30. @@




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1dba3e55-461d-49f4-b2e7-1d1d9cf33368%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/b26d4edb-fa74-4942-8a6d-d0a076803105%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Why don't you open an issue and make a mockup like this:

https://github.com/frappe/frappe/issues/807



On 08-Sep-2014, at 3:46 pm, Nguyen Do Le Bao <na...@gmail.com> wrote:

There is no code per se. 
It's more of a question on how to use the Doctype and Field. 


Take a look at this image

So I have a RuleSet Doctype, which include a bunch of Rule (as this row above here)
My rules depend on a Salary Range and a Age Range. But the ranges' options by itself are the same for all the rule in a RuleSet
(For example: I have 3 age ranges [below 50,  50-55 and 55 and above])

Is there a way to model the Doctype so that I don't need to repeat the process of entering the above fields for every row. 
Should I create a Doctype for Salary Range and Age Range ???

Thanks




On Wednesday, September 3, 2014 5:40:43 PM UTC+8, rushabh wrote:
Show the code :)


On 03-Sep-2014, at 2:53 pm, Nguyen Do Le Bao <na...@gmail.com> wrote:

Hi guys, 

So i have these custom Doctypes caledl Rule and Rule Item
Each Rule determine what values Rule Item can select for their param.

For example: 
Rule A say Age is 20,30,40,50. Rule B say Age is 10,15,18.
A Rule A item can only select within [20,30,40,50] and A Rule B Item can only select within [10, 15, 18]

This part of limiting the options i can do using client script to refresh the field. 
But to store the Age array in Rule, there is no array field. Should I just use the serialized string '20,30,40,50' or should I do sth else ? 

Thing is it can get complicated in that case, like I need a age range so [10-20,20-30] then some I need the >=10 <20 but >20 <=30. @@




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1dba3e55-461d-49f4-b2e7-1d1d9cf33368%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/b26d4edb-fa74-4942-8a6d-d0a076803105%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5BC6FAB1-3379-48CF-B87D-B0C5756E2CF8%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.