Tags

,


.xml file

<xpath expr="//button[@string='Cancel Order']" position="after">
 <button name="getinvno" string="Print EP" type="object" />
 </xpath>

.py file

def getinvno(self, cr, uid, ids,name, context=None):
 for resource in self.browse(cr,uid,ids,context=context):
 self_name = self.pool.get('account.invoice').search(cr,uid, [('origin','=',resource.name)], context=context )
 #res = self_name[0]
 for source in self.pool.get('account.invoice').browse(cr, uid, self_name, context):
 result = source.number
 return self.write(cr, uid, ids, {'invno': result}, context=context)
Advertisements