Thanks ! It's ok for the sale order but I have tried to make that also for invoices and it doesn't work... Here is my code
class account_invoice(osv.osv): _name = "account.invoice" _inherit = "account.invoice" _defaults = { 'number': lambda obj, cr, uid, context:'/' } def action_number(self, cr, uid, ids, context=None): super(account_invoice,self).action_number(cr, uid, ids, context) number = self.pool.get('ir.sequence').get(cr, uid,'account.invoice.out_invoice') nbr = int(number[6:8]) semester = nbr%3+1 response = number[:6] + str(semester) + number[9:] number = 'TEST' self.write(cr, uid, ids, {'number':response}) return True account_invoice() Could you explain to me where am i wrong ? -------------------- m2f -------------------- -- http://www.openobject.com/forum/viewtopic.php?p=53340#53340 -------------------- m2f -------------------- _______________________________________________ Tinyerp-users mailing list http://tiny.be/mailman2/listinfo/tinyerp-users
