@api.multi
def action_on_confirm(self):
partner_object= self.env['res.partner'].search([('id', '=', self.partner_id.id)])
for order in self:
if order.state == 'sale':
partner_object.write ({'last_saleorder_date': order.date_order})
return super(SaleOrder,self).action_on_confirm(self)