Issue of copytables

Hello Sir,


I have two tables called 'Site Attendance Details' and 'DSR Attendance Detail'.
From Site Attendance Details details am selecting some columns,and am passing these column values to the query.

The query result columns I want to set for the 'DSR Attendance Detail'.

if not getlist(self.doclist, 'dsr_attendance_details'):
newlist = model.copytables('Site Attendance Details', site, 'site_attendance_details', 'DSR Attendance Detail', self.doc, 'dsr_attendance_details', ['employee_type','category','emp_name'])
#msgprint(len(newlist))
site_id=self.doc.site_id
for r in newlist:
employee_type=r.employee_type
category=r.category
if(r.employee_type!='Contract'):
res=sql("select employee_type,category,emp_name from `tabEmployee` where site_id=%s and employee_type=%s and category=%s",(self.doc.site_id,employee_type,category))
#msgprint(cstr(res1))
r.employee_type=res[0][0]
r.category=res[0][1]
r.emp_name=res[0][2]
self.doclist += newlist


am not able to set all the columns of the query result.

Regards,
Nikhil



You received this message because you are subscribed to the Google Groups “Web Notes Framework Forum” group.

To post to this group, send email to wn...@googlegroups.com.

To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.

Hi Nikhil,

Which values are you not able to set? Those using the copytables function or the ones you are overwriting?

- Rushabh



On May 3, 2011, at 11:51 AM, Nikhil Kulkarni wrote:

Hello Sir,

         I have two tables called 'Site Attendance Details' and 'DSR Attendance Detail'.
 
         From Site Attendance Details details am selecting some columns,and am passing these column values to the query.

         The query result columns I want to set for the 'DSR Attendance Detail'.

         if not getlist(self.doclist, 'dsr_attendance_details'):
      newlist = model.copytables('Site Attendance Details', site, 'site_attendance_details', 'DSR Attendance Detail', self.doc, 'dsr_attendance_details', ['employee_type','category','emp_name'])
      #msgprint(len(newlist))
      site_id=self.doc.site_id
      for r in newlist:
        employee_type=r.employee_type
        category=r.category
        if(r.employee_type!='Contract'):
          res=sql("select employee_type,category,emp_name from `tabEmployee` where site_id=%s and employee_type=%s and category=%s",(self.doc.site_id,employee_type,category))
        #msgprint(cstr(res1))
        r.employee_type=res[0][0]
        r.category=res[0][1]
        r.emp_name=res[0][2]
      self.doclist += newlist  


       am not able to set all the columns of the query result.

Regards,
Nikhil

         

--
You received this message because you are subscribed to the Google Groups "Web Notes Framework Forum" group.
To post to this group, send email to wn...@googlegroups.com.
To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.

---------------------------------------------------------------------------------
erpnext

World's most affordable ERP - Rs 299/user/month






You received this message because you are subscribed to the Google Groups “Web Notes Framework Forum” group.

To post to this group, send email to wn...@googlegroups.com.

To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.


Hello Sir,

one am overwriting..How can i set query result to the 'DSR Attendance Detail' columns..?


Regards,
Nikhil

On Tue, May 3, 2011 at 12:01 PM, Rushabh Mehta <rm...@gmail.com> wrote:
Hi Nikhil,

Which values are you not able to set? Those using the copytables function or the ones you are overwriting?

- Rushabh



On May 3, 2011, at 11:51 AM, Nikhil Kulkarni wrote:

Hello Sir,

I have two tables called 'Site Attendance Details' and 'DSR Attendance Detail'.
From Site Attendance Details details am selecting some columns,and am passing these column values to the query.

The query result columns I want to set for the 'DSR Attendance Detail'.

if not getlist(self.doclist, 'dsr_attendance_details'):
newlist = model.copytables('Site Attendance Details', site, 'site_attendance_details', 'DSR Attendance Detail', self.doc, 'dsr_attendance_details', ['employee_type','category','emp_name'])
#msgprint(len(newlist))
site_id=self.doc.site_id
for r in newlist:
employee_type=r.employee_type
category=r.category
if(r.employee_type!='Contract'):
res=sql("select employee_type,category,emp_name from `tabEmployee` where site_id=%s and employee_type=%s and category=%s",(self.doc.site_id,employee_type,category))
#msgprint(cstr(res1))
r.employee_type=res[0][0]
r.category=res[0][1]
r.emp_name=res[0][2]
self.doclist += newlist


am not able to set all the columns of the query result.

Regards,
Nikhil


--
You received this message because you are subscribed to the Google Groups "Web Notes Framework Forum" group.
To post to this group, send email to wn...@googlegroups.com.
To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.

---------------------------------------------------------------------------------
erpnext

World's most affordable ERP - Rs 299/user/month






You received this message because you are subscribed to the Google Groups “Web Notes Framework Forum” group.

To post to this group, send email to wn…@googlegroups.com.

To unsubscribe from this group, send email to wnframework+un…@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.




You received this message because you are subscribed to the Google Groups “Web Notes Framework Forum” group.

To post to this group, send email to wn...@googlegroups.com.

To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.

Nikhil,

You can see the copy_tables function - its not too complex...

I can't figure why your query results are not being set (maybe you should check your query)

Also check that the table is refreshed on the client side (if you are calling this from an ajax request)

Otherwise looks okay...

- Rushabh


On May 3, 2011, at 12:09 PM, Nikhil Kulkarni wrote:


Hello Sir,

         one am overwriting..How can i set query result to the 'DSR Attendance Detail' columns..?


Regards,
Nikhil

On Tue, May 3, 2011 at 12:01 PM, Rushabh Mehta <rm...@gmail.com> wrote:
Hi Nikhil,

Which values are you not able to set? Those using the copytables function or the ones you are overwriting?

- Rushabh



On May 3, 2011, at 11:51 AM, Nikhil Kulkarni wrote:

Hello Sir,

         I have two tables called 'Site Attendance Details' and 'DSR Attendance Detail'.
 
         From Site Attendance Details details am selecting some columns,and am passing these column values to the query.

         The query result columns I want to set for the 'DSR Attendance Detail'.

         if not getlist(self.doclist, 'dsr_attendance_details'):
      newlist = model.copytables('Site Attendance Details', site, 'site_attendance_details', 'DSR Attendance Detail', self.doc, 'dsr_attendance_details', ['employee_type','category','emp_name'])
      #msgprint(len(newlist))
      site_id=self.doc.site_id
      for r in newlist:
        employee_type=r.employee_type
        category=r.category
        if(r.employee_type!='Contract'):
          res=sql("select employee_type,category,emp_name from `tabEmployee` where site_id=%s and employee_type=%s and category=%s",(self.doc.site_id,employee_type,category))
        #msgprint(cstr(res1))
        r.employee_type=res[0][0]
        r.category=res[0][1]
        r.emp_name=res[0][2]
      self.doclist += newlist  


       am not able to set all the columns of the query result.

Regards,
Nikhil

         

--
You received this message because you are subscribed to the Google Groups "Web Notes Framework Forum" group.
To post to this group, send email to wn...@googlegroups.com.
To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.

---------------------------------------------------------------------------------
erpnext

World's most affordable ERP - Rs 299/user/month





--
You received this message because you are subscribed to the Google Groups "Web Notes Framework Forum" group.
To post to this group, send email to wn...@googlegroups.com.
To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.


--
You received this message because you are subscribed to the Google Groups "Web Notes Framework Forum" group.
To post to this group, send email to wn...@googlegroups.com.
To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.

---------------------------------------------------------------------------------
erpnext

World's most affordable ERP - Rs 299/user/month






You received this message because you are subscribed to the Google Groups “Web Notes Framework Forum” group.

To post to this group, send email to wn...@googlegroups.com.

To unsubscribe from this group, send email to wnframework+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/wnframework?hl=en.