--
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...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e0f1a9b8-ff56-4e7a-862c-cd1c231b979c%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
You should use "addchild()" function to add a new row in child table.For example you can check add_default_uom_in_conversion_factor_table() function in item.py file. Basically addchild() function create an document object for row and return it. Then you can assign any column value using that object.
On 25-May-2013, at 3:08 PM, Addy wrote:
Hi,I would like to update a child table of the item master via custom script and I am unable to figure out a way to do so. Basically, I am looking to update the item website specification table automatically since all the details are there in my item master vide custom fields.Now I think that the commandwebnotes.conn.set_value("Item Website Specification", ?? , "label", "Material")webnotes.conn.set_value("Item Website Specification", ?? , "description", self.doc.base_material)should work but I am stuck at this since I am unable to find a way to know the id of the child table, since I want this value to update the first row of the table.Any suggestions.Regards,Aditya Duggal--
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+unsub...@googlegroups.com.
I have tried to run the below mentioned code but I guess something is wrong, though I am not getting any error code.def fn_add_item_website_specifications(self):web_specs = [d.label for d in self.doclist.get({"parentfield": "item_website_specification"})]if "H" not in web_specs:ch = addchild(self.doc, 'item_website_specification', 'Item Website Specification', self.doclist)ch.label = "H"ch.description = self.doc.height_diaSurely I have called the function as self.fn_add_item_website_specifications
Another couple of queries are:
- How could I ensure that if "H" exists in Label then the value for the same is updated in the system against that item since I could not find any code for the same in the item.py file.
- self.doc.web_long_description = desc_web where desc_web is a String. Now this is supposed to update the website description every time the item is edited but it does so only once and if we delete the website description then it does not update the description, again I am not getting any error code.
On Saturday, May 25, 2013 4:49:57 PM UTC+5:30, Nabin Hait wrote:You should use "addchild()" function to add a new row in child table.For example you can check add_default_uom_in_conversion_factor_table() function in item.py file. Basically addchild() function create an document object for row and return it. Then you can assign any column value using that object.On 25-May-2013, at 3:08 PM, Addy wrote:Hi,To post to this group, send email to erpnext-dev...@googlegroups.com.I would like to update a child table of the item master via custom script and I am unable to figure out a way to do so. Basically, I am looking to update the item website specification table automatically since all the details are there in my item master vide custom fields.Now I think that the commandwebnotes.conn.set_value("Item Website Specification", ?? , "label", "Material")webnotes.conn.set_value("Item Website Specification", ?? , "description", self.doc.base_material)
should work but I am stuck at this since I am unable to find a way to know the id of the child table, since I want this value to update the first row of the table.Any suggestions.Regards,Aditya Duggal--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e0f1a9b8-ff56-4e7a-862c-cd1c231b979c%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/de1633f4-157a-4e11-b030-9bf7a665cc1b%40googlegroups.com?hl=en.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e0f1a9b8-ff56-4e7a-862c-cd1c231b979c%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
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+unsub...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/de1633f4-157a-4e11-b030-9bf7a665cc1b%40googlegroups.com?hl=en.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/66559587-2858-4822-9c0a-b337f86833b8%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CANn8SW%2BY2xJGW-3VKpOD4bbupFs-dfm0Nn2_kB5n7Q-9P1JTog%40mail.gmail.com?hl=en.
How could the field be hidden, I am unable to find a reason for not able to view only that field which is created by server script other fields in the table for the same item are showing properly which were created manually.Here are the screen shots:For Item
<image.png>
For Item Website specification Report:
<image.png>
And Finally the screen shot of the webpage of the item:
<image.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAEmKBHzxMFjXSfp6Ue1wnAM20C_5B5fGhHt3fHtDp%2B%2B-FASuyg%40mail.gmail.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1698082C-4A46-4029-B308-29148FF703D2%40erpnext.com?hl=en.
<image.png>
--
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...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CB139B9B-ACD1-484E-99B3-5FB7787EEAF8%40erpnext.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAEmKBHyc1bMX%2BTX77pMW17hCVyP4cJY5-mnxP98wyFw%3DhV%2BWuQ%40mail.gmail.com?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/79E9C825-0981-4763-A37A-CF2CB17CF2E6%40erpnext.com?hl=en.
Thanks RushabhThat typo has caused a lot of delays for me.....ahhh what a small oversight can do.
Aditya,There is a typo in the table fieldnamech = addchild(self.doc, 'item_website_specifications', 'Item Website Specification', self.doclist)It should be item_website_specifications with an "s" at the end.In future, we will throw a validation if such a typo exists.best,Rushabh
The latest gist in the last post of mine maybe we were typing at the same time anyhow I am still sending the link for the same.Here is the latest GISTAlso I am not able to understand the requirement for 3 fields since in the item website specification I can see only one field which is parent.Here is the function which I am using to update the item website specification table.def fn_add_item_website_specifications(self):webnotes.msgprint("Function Line 1")web_specs = [d.label for d in self.doclist.get({"parentfield": "item_website_specification"})]webnotes.msgprint(web_specs)if "H" not in web_specs:ch = addchild(self.doc, 'item_website_specification', 'Item Website Specification', self.doclist)ch.label = "H"ch.description = self.doc.height_dia
On Mon, Jun 10, 2013 at 11:34 AM, Rushabh Mehta <rme...@gmail.com> wrote:
Aditya,Can you send your latest script on gist?You need to set 3 properties to make it show correctly as a child record: parent, parenttype, parentfieldIt seems one of those fields is not set correctlybest,
On 10-Jun-2013, at 11:22 AM, Aditya Duggal
<image.png>
--
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+unsub...@googlegroups.com.
To post to this group, send email to erpnext-developer-forum@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CB139B9B-ACD1-484E-99B3-5FB7787EEAF8%40erpnext.com?hl=en.
--
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+unsub...@googlegroups.com.
To post to this group, send email to erpnext-developer-forum@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAEmKBHyc1bMX%2BTX77pMW17hCVyP4cJY5-mnxP98wyFw%3DhV%2BWuQ%40mail.gmail.com?hl=en.
--
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+unsub...@googlegroups.com.
To post to this group, send email to erpnext-developer-forum@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/3ffc93f4-1503-471e-987c-39bd99ec5ed1%40googlegroups.com?hl=en.