Creating new instance of doctype

Hello All,

   I am using erpnext ,I have tried to create a new instance of doctype with old format like 
         inv=Document(‘Invoice’) 
         inv.period=self.doc.s_period
         inv.save(new=1)  
   but i got ‘Document’  unknown error

   can anybody help me to use wrapper.insert()  method syntax for my above example?

Thank you.
                
                



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/msg/erpnext-developer-forum/-/O-2GfVLb0PQJ.

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

 

 

Use:

d=webnotes.model_wrapper({
  "period": self.doc.s_period
})
d.insert()

Sent from mobile

On 03-Feb-2013, at 3:06 PM, gangadhar kadam <em...@gmail.com> wrote:

Hello All,
   I am using erpnext ,I have tried to create a new instance of doctype with old format like 
         inv=Document('Invoice') 
         inv.period=self.doc.s_period
         inv.save(new=1)  
   but i got 'Document'  unknown error

   can anybody help me to use wrapper.insert()  method syntax for my above example?

Thank you.
                
                



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/msg/erpnext-developer-forum/-/O-2GfVLb0PQJ.

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.

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