Hi,
data[i].insert (6,[None])
data[i].insert (6,None)
Notice I am using now None instead of [None] turns out I was inserting a list and hence all the errors were happening even with floats.
On Friday, May 31, 2013 12:42:05 PM UTC+5:30, Anand Doshi wrote:
Hi Aditya,To remove zeroes, check if the value is zero when inserting into the array and if it is 0, insert None.Sorting should work. Check Accounts Receivable report’s Age field. Even your gist looks okay. Maybe you changed something and didn’t update in the gist.Thanks,Anand.On 31-May-2013, at 12:17 PM, Aditya Duggal <ad…@rigpl.com> wrote:Dear Rushabh,I think you have not understood what I had meant.I am actually saying that the fields which are calculated are not getting sorted as per the float or Int mentioned in get_columns and those columns are being considered as text only.The column are the last 3 columns so something is not right as these columns should have been int or float but are being considered as Text only when I click on the column heading to sort, however if I try to search by filters on the column then they act as if they are numbers like 101:106 field would only show items between 101 and 106 only.So if you could really help me with the sorting part and how to remove zeros from the fields that would be great.On Fri, May 31, 2013 at 10:44 AM, Rushabh Mehta <rm...@gmail.com> wrote:
Aditya,You will have to sort the table in python before sending it. Something like:data = sorted(data, key = lambda d: d[3])if you want it sorted by the 3rd columnbest,On 30-May-2013, at 4:30 PM, Aditya Duggal <ad...@rigpl.com> wrote:Hi,I finally have found a workaround but still the earlier errors are mystery. Now this report is also complete with some things where it is lacking:
The columns which are based on calculations are showing as strings or something since their sorting is all screwed up.
- All zero values cannot be converted to NULL values again in the calculated fields which are column no [5 to 8]
You can check the gist here.The report is working fine apart from the calculated value fields which not getting sorted and I am also not able to convert the zero to null values.Let me know if you are able to find the solution to the same.On Thu, May 30, 2013 at 10:57 AM, Rushabh Mehta <rm...@gmail.com> wrote:
Aditya,Chances are that the computer is not wrong ;)
are you printing data instead of data[i]?- RushabhOn 30-May-2013, at 10:54 AM, Aditya Duggal <ad...@rigpl.com> wrote:Dear Rushabh,I have already given the msgprint of data[i] in my previous post which clearly shows that data[i] is a list with [4] item being either nonetype or float.
On Thu, May 30, 2013 at 10:45 AM, Rushabh Mehta <rm…@gmail.com> wrote:Aditya,It means data[i] is an integer not a list as expected in data[i][3]On 30-May-2013, at 12:01 AM, Aditya Duggal <ad...@rigpl.com> wrote:Hi Anand,I have tried to replace the float with flt and I am still getting the same error:TypeError: 'int' object is unsubscriptable
Maybe I am overlooking something simple or is it something more complex. I did not knew that getting a calculated field out of the result is going to take soo long for me to figure out, I thought this would be the simplest job.On Wed, May 29, 2013 at 5:33 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Aditya,At the top of the python file, write:from webnotes.utils import fltand use the flt function instead of floatThanks,Anand.On 29-May-2013, at 3:49 PM, Aditya Duggal <ad...@rigpl.com> wrote:
Now the thing is that data[i][3] is a float and some values are also NONE Type so how could I handle the same in the below code since I think the nonetype is creating some problems
Here is a msgprint of the data[i] to ensure that I am not making the same mistake as earlier:[u’C0BE269E7’, u’Carbide NB 0X BNEM \xd83x16x50 Z= 2’, None, None, None, 0]
[u’C0BE269F5’, u’Carbide NB 0X BNEM \xd84x22x50 Z= 2’, None, None, None, 100.0]
[u’C0BE269G3’, u’Carbide NB 0X BNEM \xd85x22x50 Z= 2’, None, None, None, 150.0]
[u’C0BE269H1’, u’Carbide NB 0X BNEM \xd85x35x75 Z= 2’, None, None, None, 0]
[u’C0BE269J6’, u’Carbide NB 0X BNEM \xd86x22x50 Z= 2’, None, None, None, -196.0]
[u’C0BE2A01H5’, u’Carbide ANUBIS 0X BNEM \xd83x16x50 Z= 2’, None, None, None, 0]
[u’C0BE2A01J0’, u’Carbide ANUBIS 0X BNEM \xd84x22x50 Z= 2’, None, None, None, 0]
[u’C0BE2A01K8’, u’Carbide ANUBIS 0X BNEM \xd85x22x50 Z= 2’, None, None, None, 0]
[u’C0BE2A01L6’, u’Carbide ANUBIS 0X BNEM \xd85x35x75 Z= 2’, None, None, None, 0]
[u’C0BE2A01M4’, u’Carbide ANUBIS 0X BNEM \xd86x22x50 Z= 2’, None, None, None, 0]
[u’C0BE2A69K7’, u’Carbide ANUBIS 0X BNEM \xd82x6x\xd83x38 Z= 2’, None, None, None, 0]
[u’C0BE2R6990’, u’Carbide ROHIT 0X BNEM \xd83x16x50 Z= 2’, None, None, None, 0]
[u’C0BE2R69A2’, u’Carbide ROHIT 0X BNEM \xd84x22x50 Z= 2’, None, 100.0, 2, -100.0]
[u’C0BE2R69B0’, u’Carbide ROHIT 0X BNEM \xd85x22x50 Z= 2’, None, 100.0, 1, -150.0]
[u’C0BE2R69C8’, u’Carbide ROHIT 0X BNEM \xd85x35x75 Z= 2’, None, None, None, 0]
[u’C0BE2R69D5’, u’Carbide ROHIT 0X BNEM \xd86x22x50 Z= 2’, None, 486.0, 2, -818.0]
[u’C0BE2R6BH8’, u’Carbide ROHIT 0X BNEM \xd86x35x75 180\xb0 Z= 2’, None, 10.0, 1, -50.0]
[u’C0BE2R6DX0’, u’Carbide ROHIT 0X BNEM \xd84x35x75 180\xb0 Z= 2’, None, 50.0, 2, -80.0]
[u’C0BE46B77’, u’Carbide NB 0X BNEM \xd85x22x50 Z= 4’, None, None, None, -52.0]
[u’C0BE46B85’, u’Carbide NB 0X BNEM \xd84x22x50 Z= 4’, None, None, None, -48.0]
[u’C0SE21A01N2’, u’Carbide ANUBIS 0X TiAlN SQEM \xd81x4x\xd83x38 Z= 2’, None, None, None, 0]I am still not able to figure out the problem:Code used is:i= 0while i < len(data):if not (data[i][3]):data += [0]else:data += [((float(data[i][3]) /diff)*30)]i +=1Error:--File "../app/stock/report/calculate_rol/calculate_rol.py", line 98, in get_sl_entriesif not (data[i][3]):TypeError: 'int' object is unsubscriptableOn Wed, May 29, 2013 at 3:31 PM, Aditya Duggal <ad...@rigpl.com> wrote:
Rushabh,I am still stuck on the last error and I am trying to figure out the problem once done I would update my gist since I have no idea about the forking and pushing on github and I would really need an idiot's guide on that....I hope you understand I am not a coder just a coding enthusiast nothing more.On Wed, May 29, 2013 at 1:55 PM, Rushabh Mehta <rm...@gmail.com> wrote:
Aditya if this works out, do send us the final version.Or better, a pull request so it is officially recorded as your contribution :)For that you must- set developer_mode=1- login as Administrator,- save the report (files will be created in the code folder)- commit your changes- push on your fork- send us a pull request from GitHubbest,Rushabh
On Tue, May 28, 2013 at 10:44 AM, Addy <ad...@rigpl.com> wrote:Hi Nabin,Thanks for pointing out the omission. I am facing another problem which is that I have 3 queries which I now need to join so that I could get the result in a consolidated format but I am unable to find any help on that, it would be great if you could guide me as to how should I join the 3 queries to get the consolidated result, I am attaching the report py file.
On Monday, May 27, 2013 9:46:16 AM UTC+5:30, Nabin Hait wrote:Use
tabStock Ledger Entry
instead of tabStock Ledger Entry.On 27-May-2013, at 1:43 AM, Addy wrote:<calculate_rol.py>–
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 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/e00d7c4e-4abc-49bb-8cba-46ea9bf3e0c3%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--Twitter: @rushabh_mehta–
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 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/CANn8SW%2BGSZw-BFt%3DUnhWTyNn2W59FxaG7RZv6QuBUjLdKraHUg%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+un…@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/CAEmKBHzAo3VS8%2B1Xh1gXqqdmd1rc0AL2fjZYaZzZWMpMvy7g3g%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+un…@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/F042035C-9448-4D78-A541-D77092E0B730%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+un…@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/CAEmKBHy74q_DYvu5udddt-hsEiS3K0w0Gs7RZEXCMvQ-Zqqj9Q%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+un…@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/A86455C7-2E17-4953-A969-1EFF9AA046DA%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+un…@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/CAEmKBHx3VA2ZRzPO%3DuXokD-chYMGntQmG%3Dg1OvoLvR4ia4Nhcw%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+un…@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/7E880150-4D14-4ADF-8CD1-2312894B7BB8%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+un…@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/CAEmKBHzMi2UnW0ddHr4TDq0o_NajkjKRzzY7fJjNjZ-nfZtF0Q%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+un…@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/B1F78265-3A8A-4FFF-B23B-93BE152CAA3A%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+un…@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/CAEmKBHx2C07Zr2H9Cezn0RCfbbmTkEmKOpLTDGZdoH9y3vFW5Q%40mail.gmail.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+un...@googlegroups.com.
To post to this group, send email to er...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e6f1c3af-c0d3-4b3d-85d4-486bec4cf0c6%40googlegroups.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.